diff options
Diffstat (limited to 'spec/ruby')
| -rw-r--r-- | spec/ruby/core/array/intersection_spec.rb | 11 | ||||
| -rw-r--r-- | spec/ruby/core/array/minus_spec.rb | 10 | ||||
| -rw-r--r-- | spec/ruby/core/array/union_spec.rb | 10 |
3 files changed, 16 insertions, 15 deletions
diff --git a/spec/ruby/core/array/intersection_spec.rb b/spec/ruby/core/array/intersection_spec.rb index 9eabe590d9..4d6c2a12d3 100644 --- a/spec/ruby/core/array/intersection_spec.rb +++ b/spec/ruby/core/array/intersection_spec.rb @@ -49,17 +49,18 @@ describe "Array#&" do obj1 = mock('1') obj2 = mock('2') - obj1.should_receive(:hash).at_least(1).and_return(0) - obj2.should_receive(:hash).at_least(1).and_return(0) + obj1.stub!(:hash).and_return(0) + obj2.stub!(:hash).and_return(0) obj1.should_receive(:eql?).at_least(1).and_return(true) + obj2.should_receive(:eql?).at_least(1).and_return(true) ([obj1] & [obj2]).should == [obj1] ([obj1, obj1, obj2, obj2] & [obj2]).should == [obj1] obj1 = mock('3') obj2 = mock('4') - obj1.should_receive(:hash).at_least(1).and_return(0) - obj2.should_receive(:hash).at_least(1).and_return(0) + obj1.stub!(:hash).and_return(0) + obj2.stub!(:hash).and_return(0) obj1.should_receive(:eql?).at_least(1).and_return(false) ([obj1] & [obj2]).should == [] @@ -78,7 +79,7 @@ describe "Array#&" do it "properly handles an identical item even when its #eql? isn't reflexive" do x = mock('x') - x.should_receive(:hash).at_least(1).and_return(42) + x.stub!(:hash).and_return(42) x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI. ([x] & [x]).should == [x] diff --git a/spec/ruby/core/array/minus_spec.rb b/spec/ruby/core/array/minus_spec.rb index 5ef90385eb..ffb8d7db06 100644 --- a/spec/ruby/core/array/minus_spec.rb +++ b/spec/ruby/core/array/minus_spec.rb @@ -46,8 +46,8 @@ describe "Array#-" do it "removes an item identified as equivalent via #hash and #eql?" do obj1 = mock('1') obj2 = mock('2') - obj1.should_receive(:hash).at_least(1).and_return(0) - obj2.should_receive(:hash).at_least(1).and_return(0) + obj1.stub!(:hash).and_return(0) + obj2.stub!(:hash).and_return(0) obj1.should_receive(:eql?).at_least(1).and_return(true) ([obj1] - [obj2]).should == [] @@ -57,8 +57,8 @@ describe "Array#-" do it "doesn't remove an item with the same hash but not #eql?" do obj1 = mock('1') obj2 = mock('2') - obj1.should_receive(:hash).at_least(1).and_return(0) - obj2.should_receive(:hash).at_least(1).and_return(0) + obj1.stub!(:hash).and_return(0) + obj2.stub!(:hash).and_return(0) obj1.should_receive(:eql?).at_least(1).and_return(false) ([obj1] - [obj2]).should == [obj1] @@ -67,7 +67,7 @@ describe "Array#-" do it "removes an identical item even when its #eql? isn't reflexive" do x = mock('x') - x.should_receive(:hash).at_least(1).and_return(42) + x.stub!(:hash).and_return(42) x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI. ([x] - [x]).should == [] diff --git a/spec/ruby/core/array/union_spec.rb b/spec/ruby/core/array/union_spec.rb index f7fd5c43ac..58fe23448d 100644 --- a/spec/ruby/core/array/union_spec.rb +++ b/spec/ruby/core/array/union_spec.rb @@ -45,8 +45,8 @@ describe "Array#|" do obj1 = mock('1') obj2 = mock('2') - obj1.should_receive(:hash).at_least(1).and_return(0) - obj2.should_receive(:hash).at_least(1).and_return(0) + obj1.stub!(:hash).and_return(0) + obj2.stub!(:hash).and_return(0) obj2.should_receive(:eql?).at_least(1).and_return(true) ([obj1] | [obj2]).should == [obj1] @@ -54,8 +54,8 @@ describe "Array#|" do obj1 = mock('3') obj2 = mock('4') - obj1.should_receive(:hash).at_least(1).and_return(0) - obj2.should_receive(:hash).at_least(1).and_return(0) + obj1.stub!(:hash).and_return(0) + obj2.stub!(:hash).and_return(0) obj2.should_receive(:eql?).at_least(1).and_return(false) ([obj1] | [obj2]).should == [obj1, obj2] @@ -74,7 +74,7 @@ describe "Array#|" do it "properly handles an identical item even when its #eql? isn't reflexive" do x = mock('x') - x.should_receive(:hash).at_least(1).and_return(42) + x.stub!(:hash).and_return(42) x.stub!(:eql?).and_return(false) # Stubbed for clarity and latitude in implementation; not actually sent by MRI. ([x] | [x]).should == [x] |
