diff options
Diffstat (limited to 'spec/ruby/core/kernel')
| -rw-r--r-- | spec/ruby/core/kernel/Rational_spec.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/kernel/shared/sprintf.rb | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/kernel/Rational_spec.rb b/spec/ruby/core/kernel/Rational_spec.rb index cc11a35451..7e63e0dd57 100644 --- a/spec/ruby/core/kernel/Rational_spec.rb +++ b/spec/ruby/core/kernel/Rational_spec.rb @@ -131,7 +131,7 @@ describe "Kernel.Rational" do obj = Object.new def obj.to_r; []; end - -> { Rational(obj) }.should raise_error(TypeError, "can't convert Object to Rational (Object#to_r gives Array)") + -> { Rational(obj) }.should raise_consistent_error(TypeError, "can't convert Object into Rational (Object#to_r gives Array)") end end diff --git a/spec/ruby/core/kernel/shared/sprintf.rb b/spec/ruby/core/kernel/shared/sprintf.rb index 2b2c6c9b63..5ffe118035 100644 --- a/spec/ruby/core/kernel/shared/sprintf.rb +++ b/spec/ruby/core/kernel/shared/sprintf.rb @@ -306,13 +306,13 @@ describe :kernel_sprintf, shared: true do it "raises TypeError if argument is not String or Integer and cannot be converted to them" do -> { @method.call("%c", []) - }.should raise_error(TypeError, /no implicit conversion of Array into Integer/) + }.should raise_consistent_error(TypeError, /no implicit conversion of Array into Integer/) end it "raises TypeError if argument is nil" do -> { @method.call("%c", nil) - }.should raise_error(TypeError, /no implicit conversion from nil to integer/) + }.should raise_consistent_error(TypeError, /no implicit conversion of nil into Integer/) end it "tries to convert argument to String with to_str" do @@ -341,7 +341,7 @@ describe :kernel_sprintf, shared: true do -> { @method.call("%c", obj) - }.should raise_error(TypeError, /can't convert BasicObject to String/) + }.should raise_consistent_error(TypeError, /can't convert BasicObject into String/) end it "raises TypeError if converting to Integer with to_int returns non-Integer" do @@ -352,7 +352,7 @@ describe :kernel_sprintf, shared: true do -> { @method.call("%c", obj) - }.should raise_error(TypeError, /can't convert BasicObject to Integer/) + }.should raise_consistent_error(TypeError, /can't convert BasicObject into Integer/) end end |
