THRIFT-712. rb: Inspect should print binary fields as hex instead of escaped string
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911610 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index 4b46284..c1271b9 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -68,6 +68,10 @@
StructWithEnumMap.new(:my_map => {SomeEnum::ONE => [SomeEnum::TWO]}).inspect.should == "<SpecNamespace::StructWithEnumMap my_map:{ONE (0): [TWO (1)]}>"
end
+ it "should pretty print binary fields" do
+ Foo2.new(:my_binary => "\001\002\003").inspect.should == "<SpecNamespace::Foo2 my_binary:010203>"
+ end
+
it "should offer field? methods" do
Foo.new.opt_string?.should be_false
Foo.new(:simple => 52).simple?.should be_true