Aaric,
I might be missing something, but the following:
```
RSpec.describe 'A' do
it do
opportunity1 = 1
opportunity2 = 2
client_mock = double
allow(client_mock).to
receive(:get_opportunity).with("1234567890").and_return(opportunity1)
allow(client_mock).to
receive(:get_opportunity).with("0987654321").and_return(opportunity2)
expect(client_mock.get_opportunity("1234567890")).to eq 1
expect(client_mock.get_opportunity("0987654321")).to eq 2
end
end
```
passes just fine.
Even if you swap the call order.
Even if you call `get_opportunity` several times with the same argument.
How do you define `client_mock` exactly?
- Phil
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/CAAk5Ok-8vq1FpxF5TJfHzVUsqX-snxEHa1pe41zzAroVq-rNAg%40mail.gmail.com.