[rspec-users] should_receive - how to allow multiple calls
dchelimsky at gmail.com
Tue Jul 15 07:58:21 EDT 2008
On Tue, Jul 15, 2008 at 3:00 AM, Piotr Wlodarek <lists at ruby-forum.com> wrote:
> info( 'attempting to sign in' ) # I want to test it
> # ...
> info( 'signed in' ) # I don't care about it
> @scraper.should_receive( :info ).with( 'attempting to sign in'
> ).at_least( 1 ).times
> expected :info with ("attempting to sign in") but received it with
> ("signed in")
> This is strange.
This is normal :) It's how most mock frameworks work because most of
the time we want to know if unexpected calls start showing up.
> How to test if method was called with specific argument
> AND don't care about other possible calls of that method?
@scraper.should_receive(:info).with("attempting to sign in")
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users