THRIFT-709. Print enum value names in Ruby
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@911500 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/union_spec.rb b/lib/rb/spec/union_spec.rb
index 07a3f94..f39d033 100644
--- a/lib/rb/spec/union_spec.rb
+++ b/lib/rb/spec/union_spec.rb
@@ -147,5 +147,11 @@
union.get_set_field.should == :integer32
union.get_value.should == 26
end
+
+ it "should print enum value name when inspected" do
+ My_union.new(:some_enum => SomeEnum::ONE).inspect.should == "<SpecNamespace::My_union some_enum: ONE (0)>"
+
+ My_union.new(:my_map => {SomeEnum::ONE => [SomeEnum::TWO]}).inspect.should == "<SpecNamespace::My_union my_map: {ONE (0): [TWO (1)]}>"
+ end
end
end