diff options
Diffstat (limited to 'spec/ruby/core/numeric/remainder_spec.rb')
| -rw-r--r-- | spec/ruby/core/numeric/remainder_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/ruby/core/numeric/remainder_spec.rb b/spec/ruby/core/numeric/remainder_spec.rb index 1e2f5f3a96..bdf7358b21 100644 --- a/spec/ruby/core/numeric/remainder_spec.rb +++ b/spec/ruby/core/numeric/remainder_spec.rb @@ -6,13 +6,14 @@ describe "Numeric#remainder" 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 |
