From: Bryan Duxbury Date: Sat, 27 Feb 2010 05:47:15 +0000 (+0000) Subject: THRIFT-715. rb: Add additional test case for serialization of false boolean fields X-Git-Tag: 0.3.0~110 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=30dd725952ddce68eecc645426443a5ebb3bec52;p=common%2Fthrift.git THRIFT-715. rb: Add additional test case for serialization of false boolean fields git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@916911 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb index c937023d..59a40181 100644 --- a/lib/rb/spec/struct_spec.rb +++ b/lib/rb/spec/struct_spec.rb @@ -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"))