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
|
@ -7,11 +7,11 @@ describe :rational_div_rat, shared: true do
|
|||
end
|
||||
|
||||
it "raises a ZeroDivisionError when the argument has a numerator of 0" do
|
||||
lambda { Rational(3, 4).div(Rational(0, 3)) }.should raise_error(ZeroDivisionError)
|
||||
-> { Rational(3, 4).div(Rational(0, 3)) }.should raise_error(ZeroDivisionError)
|
||||
end
|
||||
|
||||
it "raises a ZeroDivisionError when the argument has a numerator of 0.0" do
|
||||
lambda { Rational(3, 4).div(Rational(0.0, 3)) }.should raise_error(ZeroDivisionError)
|
||||
-> { Rational(3, 4).div(Rational(0.0, 3)) }.should raise_error(ZeroDivisionError)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -23,7 +23,7 @@ describe :rational_div_float, shared: true do
|
|||
end
|
||||
|
||||
it "raises a ZeroDivisionError when the argument is 0.0" do
|
||||
lambda { Rational(3, 4).div(0.0) }.should raise_error(ZeroDivisionError)
|
||||
-> { Rational(3, 4).div(0.0) }.should raise_error(ZeroDivisionError)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -34,7 +34,7 @@ describe :rational_div_int, shared: true do
|
|||
end
|
||||
|
||||
it "raises a ZeroDivisionError when the argument is 0" do
|
||||
lambda { Rational(3, 4).div(0) }.should raise_error(ZeroDivisionError)
|
||||
-> { Rational(3, 4).div(0) }.should raise_error(ZeroDivisionError)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -44,11 +44,11 @@ describe :rational_div, shared: true do
|
|||
end
|
||||
|
||||
it "raises an ArgumentError if passed more than one argument" do
|
||||
lambda { Rational(3, 4).div(2,3) }.should raise_error(ArgumentError)
|
||||
-> { Rational(3, 4).div(2,3) }.should raise_error(ArgumentError)
|
||||
end
|
||||
|
||||
# See http://redmine.ruby-lang.org/issues/show/1648
|
||||
it "raises a TypeError if passed a non-numeric argument" do
|
||||
lambda { Rational(3, 4).div([]) }.should raise_error(TypeError)
|
||||
-> { Rational(3, 4).div([]) }.should raise_error(TypeError)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue