From 30dd725952ddce68eecc645426443a5ebb3bec52 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Sat, 27 Feb 2010 05:47:15 +0000 Subject: [PATCH] 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 --- lib/rb/spec/struct_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) 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")) -- 2.17.1