THRIFT-4289: fix ruby unit test compatibility for 2.4 Fixnum Integer handling
diff --git a/lib/rb/spec/struct_spec.rb b/lib/rb/spec/struct_spec.rb
index b09c7f6..bbd502b 100644
--- a/lib/rb/spec/struct_spec.rb
+++ b/lib/rb/spec/struct_spec.rb
@@ -227,7 +227,7 @@
it "should support optional type-checking in Thrift::Struct.new" do
Thrift.type_checking = true
begin
- expect { SpecNamespace::Hello.new(:greeting => 3) }.to raise_error(Thrift::TypeError, "Expected Types::STRING, received Fixnum for field greeting")
+ expect { SpecNamespace::Hello.new(:greeting => 3) }.to raise_error(Thrift::TypeError, /Expected Types::STRING, received (Integer|Fixnum) for field greeting/)
ensure
Thrift.type_checking = false
end
@@ -238,7 +238,7 @@
Thrift.type_checking = true
begin
hello = SpecNamespace::Hello.new
- expect { hello.greeting = 3 }.to raise_error(Thrift::TypeError, "Expected Types::STRING, received Fixnum for field greeting")
+ expect { hello.greeting = 3 }.to raise_error(Thrift::TypeError, /Expected Types::STRING, received (Integer|Fixnum) for field greeting/)
ensure
Thrift.type_checking = false
end