title: Mocha: How to add expectation of a method when there are multiple invocations with different parameters
body: <p>I have a Rails controller action to test. In that action, a method User.can? is invoked several times with different parameters. In one of the test case for it, I want to make sure that User.can?('withdraw') is invoked. But I don't care about invocations of User.can? with other parameters.</p>
  
  <pre><code>def action_to_be_tested
    ...
    @user.can?('withdraw')
    ...
    @user.can?('deposit')
    ...
  end
  </code></pre>
  
  <p>I tried below in the test:</p>
  
  <pre><code>User.any_instance.expects(:can?).with('withdraw').at_least_once.returns(true)
  </code></pre>
  
  <p>But the test failed with message indicating unexpected invocation of User.can?('deposit').
  If I add another expectation with parameter 'deposit', the test passed. But I am wondering if there are any ways such that I could just focus on the invocation with 'withdraw' parameter (because other invocations are irrelevant to this test case).</p>