diff options
Diffstat (limited to 'spec/ruby/core/array/intersection_spec.rb')
-rw-r--r-- | spec/ruby/core/array/intersection_spec.rb | 11 |
1 files changed, 6 insertions, 5 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] |