rb: Display field name in type-checking error [THRIFT-78]
Author: Kevin Ballard <kevin@rapleaf.com>
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@678059 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index eb0542b..2245778 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -177,7 +177,7 @@
it "should support optional type-checking in Thrift::Struct.new" do
Thrift.type_checking = true
begin
- lambda { Hello.new(:greeting => 3) }.should raise_error(TypeError, "Expected Types::STRING, received Fixnum")
+ lambda { Hello.new(:greeting => 3) }.should raise_error(TypeError, "Expected Types::STRING, received Fixnum for field greeting")
ensure
Thrift.type_checking = false
end
@@ -188,7 +188,7 @@
Thrift.type_checking = true
begin
hello = Hello.new
- lambda { hello.greeting = 3 }.should raise_error(TypeError, "Expected Types::STRING, received Fixnum")
+ lambda { hello.greeting = 3 }.should raise_error(TypeError, "Expected Types::STRING, received Fixnum for field greeting")
ensure
Thrift.type_checking = false
end