Now we're getting somewhere. First test written and passed.

This commit is contained in:
Nick Thomas
2011-05-18 19:16:47 +01:00
parent 7d3848abca
commit f3f89283e2
2 changed files with 67 additions and 57 deletions

View File

@@ -5,13 +5,18 @@ require 'btc_wire_proto'
SERVICE_MASK = "\x00\x00\x00\x01" # Sets NODE_NETWORK
include ::BtcWireProto
describe ::BtcWireProto do
describe BtcWireProto do
# Payload fragments
describe ServicesMask do
it "should have node_network set to false when its bit is 0" do
s = BtcWireProto::ServicesMask::read("\x00\x00\x00\x00")
s.node_network.should == false
s = ServicesMask::read("\x00" * 8) # All 64 bits unset
s.node_network.should == 0
s = ServicesMask::read("\x00" * 7 + "\x01")
s.node_network.should == 1
end
end
@@ -31,7 +36,7 @@ describe BtcWireProto do
end
describe TransactionOut do
end
describe BlockHeader do
describe BlockHdr do
end
# Payloads