summaryrefslogtreecommitdiff
path: root/spec/ruby/core/numeric/remainder_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/numeric/remainder_spec.rb')
-rw-r--r--spec/ruby/core/numeric/remainder_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/ruby/core/numeric/remainder_spec.rb b/spec/ruby/core/numeric/remainder_spec.rb
index 6d26d39669..bdf7358b21 100644
--- a/spec/ruby/core/numeric/remainder_spec.rb
+++ b/spec/ruby/core/numeric/remainder_spec.rb
@@ -1,18 +1,19 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe "Numeric#remainder" do
before :each do
@obj = NumericSpecs::Subclass.new
@result = mock("Numeric#% result")
@other = mock("Passed Object")
+ @other.should_receive(:coerce).with(@obj).and_return([@obj, @other])
end
it "returns the result of calling self#% with other if self is 0" do
@obj.should_receive(:%).with(@other).and_return(@result)
@result.should_receive(:==).with(0).and_return(true)
- @obj.remainder(@other).should equal(@result)
+ @obj.remainder(@other).should.equal?(@result)
end
it "returns the result of calling self#% with other if self and other are greater than 0" do
@@ -24,7 +25,7 @@ describe "Numeric#remainder" do
@obj.should_receive(:>).with(0).and_return(true)
@other.should_receive(:<).with(0).and_return(false)
- @obj.remainder(@other).should equal(@result)
+ @obj.remainder(@other).should.equal?(@result)
end
it "returns the result of calling self#% with other if self and other are less than 0" do
@@ -36,7 +37,7 @@ describe "Numeric#remainder" do
@obj.should_receive(:>).with(0).and_return(false)
- @obj.remainder(@other).should equal(@result)
+ @obj.remainder(@other).should.equal?(@result)
end
it "returns the result of calling self#% with other - other if self is greater than 0 and other is less than 0" do