public
Description: Behaviour Driven Development framework for Ruby
Homepage: http://rspec.info
Clone URL: git://github.com/dchelimsky/rspec.git
Click here to lend your support to: rspec and make a donation at www.pledgie.com !
Fixed bug when should_receive(:foo).any_number_of_times is called after similar 
stub
Fixes LH[#536]
pat-maddox (author)
Fri Sep 19 08:41:10 -0700 2008
commit  d868cf0ab0338fd7842669186c2e453cd564470b
tree    27cd4c050d37c037eb9b7eee202652de7d4a40c8
parent  fab5ddf620d9a475c59c0621404a584e184de7fe
...
126
127
128
129
 
130
131
132
...
126
127
128
 
129
130
131
132
0
@@ -126,7 +126,7 @@ module Spec
0
       end
0
 
0
       def called_max_times?
0
-        @expected_received_count == :any ||
0
+        @expected_received_count != :any &&
0
           @actual_received_count >= @expected_received_count
0
       end
0
       
...
23
24
25
 
 
 
 
 
 
 
26
27
28
...
23
24
25
26
27
28
29
30
31
32
33
34
35
0
@@ -23,6 +23,13 @@ module Spec
0
       it "should pass if any number of times method is not called" do
0
         @mock.should_receive(:random_call).any_number_of_times
0
       end
0
+
0
+      it "should return the mocked value when called after a similar stub" do
0
+        @mock.stub!(:message).and_return :stub_value
0
+        @mock.should_receive(:message).any_number_of_times.and_return(:mock_value)
0
+        @mock.message.should == :mock_value
0
+        @mock.message.should == :mock_value
0
+      end
0
     end
0
 
0
   end

Comments