[rspec-users] should_receive.again

Jonathan Linowes jonathan at parkerhill.com
Sat Jun 2 23:17:01 EDT 2007


Hi,

It appears that if I have 2 should_receives in a row, the latest one  
overrides the previous one(s).

If there isn't one, could we add a way to accumulate them, such as

@thing.should_receive(:method).and_return(@value)
@thing.should_receive(:method).again.and_return(@value)
@thing.should_receive(:method).again.and_return(@value)

would be equivalent to

@thing.should_receive(:method).times(3).and_return(@value)

This would be helpful because I have a setup method that sets up the  
should_receive once, and then some specific actions may use that  
method one or more additional times.

thanks
linoj




More information about the rspec-users mailing list