1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -16,11 +16,11 @@ describe "Numeric#quo" do
end
it "raises a ZeroDivisionError when the given Integer is 0" do
lambda { 0.quo(0) }.should raise_error(ZeroDivisionError)
lambda { 10.quo(0) }.should raise_error(ZeroDivisionError)
lambda { -10.quo(0) }.should raise_error(ZeroDivisionError)
lambda { bignum_value.quo(0) }.should raise_error(ZeroDivisionError)
lambda { -bignum_value.quo(0) }.should raise_error(ZeroDivisionError)
-> { 0.quo(0) }.should raise_error(ZeroDivisionError)
-> { 10.quo(0) }.should raise_error(ZeroDivisionError)
-> { -10.quo(0) }.should raise_error(ZeroDivisionError)
-> { bignum_value.quo(0) }.should raise_error(ZeroDivisionError)
-> { -bignum_value.quo(0) }.should raise_error(ZeroDivisionError)
end
it "calls #to_r to convert the object to a Rational" do
@ -34,16 +34,16 @@ describe "Numeric#quo" do
obj = NumericSpecs::Subclass.new
obj.should_receive(:to_r).and_return(1)
lambda { obj.quo(19) }.should raise_error(TypeError)
-> { obj.quo(19) }.should raise_error(TypeError)
end
it "raises a TypeError when given a non-Integer" do
lambda {
-> {
(obj = mock('x')).should_not_receive(:to_int)
13.quo(obj)
}.should raise_error(TypeError)
lambda { 13.quo("10") }.should raise_error(TypeError)
lambda { 13.quo(:symbol) }.should raise_error(TypeError)
-> { 13.quo("10") }.should raise_error(TypeError)
-> { 13.quo(:symbol) }.should raise_error(TypeError)
end
it "returns the result of calling self#/ with other" do