summaryrefslogtreecommitdiff
path: root/spec/ruby/core/integer/gte_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/integer/gte_spec.rb')
-rw-r--r--spec/ruby/core/integer/gte_spec.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/ruby/core/integer/gte_spec.rb b/spec/ruby/core/integer/gte_spec.rb
index 6237fc2c51..e5cb892efd 100644
--- a/spec/ruby/core/integer/gte_spec.rb
+++ b/spec/ruby/core/integer/gte_spec.rb
@@ -18,8 +18,8 @@ describe "Integer#>=" do
end
it "raises an ArgumentError when given a non-Integer" do
- -> { 5 >= "4" }.should raise_error(ArgumentError)
- -> { 5 >= mock('x') }.should raise_error(ArgumentError)
+ -> { 5 >= "4" }.should.raise(ArgumentError)
+ -> { 5 >= mock('x') }.should.raise(ArgumentError)
end
end
@@ -36,8 +36,13 @@ describe "Integer#>=" do
end
it "raises an ArgumentError when given a non-Integer" do
- -> { @bignum >= "4" }.should raise_error(ArgumentError)
- -> { @bignum >= mock('str') }.should raise_error(ArgumentError)
+ -> { @bignum >= "4" }.should.raise(ArgumentError)
+ -> { @bignum >= mock('str') }.should.raise(ArgumentError)
+ end
+
+ it "dispatches the correct operator after coercion" do
+ (bignum_value >= IntegerSpecs::CoercibleNumeric.new(1)).should == true
+ (bignum_value >= IntegerSpecs::CoercibleNumeric.new(bignum_value * 2)).should == false
end
end
end