[rspec-users] odd mock behavior

Micah Martin micah at 8thlight.com
Wed Feb 7 11:59:25 EST 2007

I'm seeing some odd behavior around the should_receive() when given a  
block combined with some cardinality.

For example, with the following...

my_mock.should_receive(:foo).twice do |i|
	puts i

... the spec passes but i never gets puts'ed.

With the following...

my_mock.should_receive(:foo) do |i|
	puts i

... i gets puts'ed twice but the spec fails because it was only  
expecting one call to :foo.

Micah Martin
8th Light, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070207/19e5c667/attachment-0001.html 

More information about the rspec-users mailing list