title: How to filter out one method call from many others with `expect().to receive()` in RSpec
body: <p>I have such a code:</p>
  
  <pre><code>class ClassB
    def print_letter(arg)
    end
  end
  
  class ClassA
    def self.my_method
      ClassB.print_letter("a")
      ClassB.print_letter("b")
    end
  end
  
  RSpec.describe ClassA do
    describe "self.my_method" do
      it "prints a" do
        allow(ClassB)
        expect(ClassB).to receive(:print_letter).once.with("a")
        described_class.my_method
      end
    end
  end
  </code></pre>
  
  <p>And I'm getting a failure:</p>
  
  <blockquote>
  <pre><code>#&lt;ClassB (class)&gt; received :print_letter with unexpected arguments
    expected: ("a")
         got: ("b")
  </code></pre>
  </blockquote>
  
  <p>Can I do anything with that? Is there any way to force the <code>receive</code> method to analyze all method calls and pick the one where arguments match, not only the last one? BTW, this behavior seems confusing to me.</p>