THRIFT-715. rb: Add additional test case for serialization of false boolean fields
authorBryan Duxbury <bryanduxbury@apache.org>
Sat, 27 Feb 2010 05:47:15 +0000 (05:47 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Sat, 27 Feb 2010 05:47:15 +0000 (05:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@916911 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/spec/struct_spec.rb

index c937023..59a4018 100644 (file)
@@ -135,6 +135,13 @@ class ThriftStructSpec < Spec::ExampleGroup
       struct.shorts.should == Set.new([3, 2])
     end
 
+    it "should serialize false boolean fields correctly" do
+      b = BoolStruct.new(:yesno => false)
+      prot = BinaryProtocol.new(MemoryBufferTransport.new)
+      prot.should_receive(:write_bool).with(false)
+      b.write(prot)
+    end
+
     it "should skip unexpected fields in structs and use default values" do
       struct = Foo.new
       prot = BaseProtocol.new(mock("transport"))