Add Message#cmd_sym as a convenience method

This commit is contained in:
Nick Thomas
2011-06-09 22:03:57 +01:00
parent 1e46836b46
commit e26105b158
2 changed files with 19 additions and 0 deletions

View File

@@ -235,6 +235,11 @@ describe ::BtcWireProto do
m.payload.selection.should == "version"
end
it "should have a :version command symbol" do
m = Message::new(:header => {:command => 'version'})
m.cmd_sym.should == :version
end
it "should parse binary data correctly" do
m = Message::read(binary(%w{
F9 BE B4 D9 76 65 72 73 69 6F 6E 00 00 00 00 00 55 00 00
@@ -265,6 +270,11 @@ describe ::BtcWireProto do
m = Message.new(:header => {:command => "verack"})
m.payload.selection.should == "null"
end
it "should have a :verack command symbol" do
m = Message.new(:header => {:command => "verack"})
m.cmd_sym.should == :verack
end
it "should parse the binary data correctly" do
m = Message::read(binary(%w{