[rspec-users] should_receive twice and arguments

Ivo Dancet ivo.dancet at gmail.com
Sun Jan 13 07:56:09 EST 2008

Hi all, I have a method calling Klass.create! two times with different  
arguments (this happens in a class reponsable for reading in a csv file)

I want to test those like this:

in one test: Klass.should_receive(:create!).with(:name => "foo").once
in another: Klass.should_receive(:create!).with(:name => "foo2").once

This doesn't work because the 'once' is only about the create! call,  
it doesn't use the arguments to make the call unique. Can I make this  
work another way (not only should_receive(:create!).twice, I want to  
test the arguments).

Thanks for any feedback.


More information about the rspec-users mailing list