You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2010/02/27 06:47:15 UTC
svn commit: r916911 - /incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
Author: bryanduxbury
Date: Sat Feb 27 05:47:15 2010
New Revision: 916911
URL: http://svn.apache.org/viewvc?rev=916911&view=rev
Log:
THRIFT-715. rb: Add additional test case for serialization of false boolean fields
Modified:
incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
Modified: incubator/thrift/trunk/lib/rb/spec/struct_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/struct_spec.rb?rev=916911&r1=916910&r2=916911&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/struct_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/struct_spec.rb Sat Feb 27 05:47:15 2010
@@ -135,6 +135,13 @@
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"))