diff options
Diffstat (limited to 'spec/ruby/core/integer/comparison_spec.rb')
| -rw-r--r-- | spec/ruby/core/integer/comparison_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/ruby/core/integer/comparison_spec.rb b/spec/ruby/core/integer/comparison_spec.rb index 4cf1d7cdc7..762af51535 100644 --- a/spec/ruby/core/integer/comparison_spec.rb +++ b/spec/ruby/core/integer/comparison_spec.rb @@ -127,7 +127,7 @@ describe "Integer#<=>" do ruby_version_is ""..."2.5" do it "returns nil if #coerce raises an exception" do @num.should_receive(:coerce).with(@big).and_raise(RuntimeError) - lambda { + -> { @result = (@big <=> @num) }.should complain(/Numerical comparison operators will no more rescue exceptions/) @result.should be_nil @@ -137,7 +137,7 @@ describe "Integer#<=>" do ruby_version_is "2.5" do it "lets the exception go through if #coerce raises an exception" do @num.should_receive(:coerce).with(@big).and_raise(RuntimeError.new("my error")) - lambda { + -> { @big <=> @num }.should raise_error(RuntimeError, "my error") end @@ -145,7 +145,7 @@ describe "Integer#<=>" do it "raises an exception if #coerce raises a non-StandardError exception" do @num.should_receive(:coerce).with(@big).and_raise(Exception) - lambda { @big <=> @num }.should raise_error(Exception) + -> { @big <=> @num }.should raise_error(Exception) end it "returns nil if #coerce does not return an Array" do |
