title: RSpec: specifying multiple calls to a method with different argument each time
body: <p>In rspec (1.2.9), what is the correct way to specify that an object will receive multiple calls to a method with a different argument each time?</p>
  
  <p>I ask because of this confusing result:</p>
  
  <pre><code>describe Object do
  
    it "passes, as expected" do
      foo = mock('foo')
      foo.should_receive(:bar).once.ordered.with(1)
      foo.should_receive(:bar).once.ordered.with(2)
      foo.bar(1)
      foo.bar(2)
    end
  
    it "fails, as expected" do
      foo = mock('foo')
      foo.should_receive(:bar).once.ordered.with(1) # =&gt; Mock "foo" expected :bar with (1) once, but received it twice
      foo.should_receive(:bar).once.ordered.with(2)
      foo.bar(1)
      foo.bar(1)
      foo.bar(2)
    end
  
    it "fails, as expected" do
      foo = mock('foo')
      foo.should_receive(:bar).once.ordered.with(1)
      foo.should_receive(:bar).once.ordered.with(2)
      foo.bar(2) # =&gt; Mock "foo" received :bar out of order
      foo.bar(1)
    end
  
    it "fails, as expected, but with an unexpected message" do
      foo = mock('foo')
      foo.should_receive(:bar).once.ordered.with(1)
      foo.should_receive(:bar).once.ordered.with(2)
      foo.bar(1)
      foo.bar(999) # =&gt; Mock "foo" received :bar with unexpected arguments
                   # =&gt;   expected: (1)
                   # =&gt;         got (999)
    end
  
  end
  </code></pre>
  
  <p>I expected the last failure message to be "expected: (2)", not "expected (1)".  Have I used rspec incorrectly?</p>