mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@875a09e
This commit is contained in:
parent
a06301b103
commit
5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue