This is an automated email from the ASF dual-hosted git repository.
jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new b5471f6 THRIFT-4289: fix ruby unit test compatibility for 2.4 Fixnum
Integer handling
b5471f6 is described below
commit b5471f63cb4bb8e3b00835a9ca9e48ff76a3bb51
Author: James E. King III <[email protected]>
AuthorDate: Sun Jun 10 15:55:12 2018 +0000
THRIFT-4289: fix ruby unit test compatibility for 2.4 Fixnum Integer
handling
---
lib/rb/spec/struct_spec.rb | 4 ++--
lib/rb/spec/types_spec.rb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
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 @@ describe 'Struct' do
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 @@ describe 'Struct' do
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
diff --git a/lib/rb/spec/types_spec.rb b/lib/rb/spec/types_spec.rb
index 364c2a7..d595ab5 100644
--- a/lib/rb/spec/types_spec.rb
+++ b/lib/rb/spec/types_spec.rb
@@ -100,9 +100,9 @@ describe Thrift::Types do
end
it "should give the Thrift::TypeError a readable message" do
- msg = "Expected Types::STRING, received Fixnum for field foo"
+ msg = /Expected Types::STRING, received (Integer|Fixnum) for field foo/
expect { Thrift.check_type(3, {:type => Thrift::Types::STRING}, :foo)
}.to raise_error(Thrift::TypeError, msg)
- msg = "Expected Types::STRING, received Fixnum for field foo.element"
+ msg = /Expected Types::STRING, received (Integer|Fixnum) for field
foo.element/
field = {:type => Thrift::Types::LIST, :element => {:type =>
Thrift::Types::STRING}}
expect { Thrift.check_type([3], field, :foo) }.to
raise_error(Thrift::TypeError, msg)
msg = "Expected Types::I32, received NilClass for field foo.element.key"
--
To stop receiving notification emails like this one, please contact
[email protected].