myclass.should_receive(:my_method).any_number_of_times - can be satisfied by nothing happening #131

baob opened this Issue May 3, 2012 · 3 comments


None yet

4 participants

baob commented May 3, 2012

myclass.should_receive(:my_method).any_number_of_times is a weird 'assertion', it can be satisfied by nothing happening (any number of times includes 0 times)

So if the intent was that the method should be invoked, that's overridden by allowing zero times.

Maybe this combination should

  • raise a warning (or error) message, or
  • disallow the zero times and treat it as at_least(:once) or
  • both.

@dchelimsky suggested a deprecation notice on twitter. See --!/baob/status/198110647110737920



FYI - see the discussion at #133.


Is this still an issue?


Nope. It can be closed. We now issue a deprecation warning.

@samphippen samphippen closed this Jun 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment