rb: When passing unknown keys to Thrift::Struct.new, report those keys in the exception [THRIFT-51]
Author: kevin@rapleaf.com
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670989 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index 6ff9bdb..6dd2868 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -196,7 +196,8 @@
end
it "should raise an exception when unknown types are given to Thrift::Struct.new" do
- lambda { Hello.new(:fish => 'salmon') }.should raise_error(Exception, "Unknown arguments given to SpecNamespace::Hello.new")
+ lambda { Hello.new(:fish => 'salmon') }.should raise_error(Exception, "Unknown keys given to SpecNamespace::Hello.new: fish")
+ lambda { Hello.new(:foo => 'bar', :baz => 'blah', :greeting => 'Good day') }.should raise_error(Exception, /^Unknown keys given to SpecNamespace::Hello.new: (foo, baz|baz, foo)$/)
end
end
end