Closed DivineDominion closed 10 years ago
Cf. #41: I found out the syntax is have_received(:foo, any_args)
.
Let me rephrase this issue, though: please make this the default or use with(any_args)
to clarify the intent. That'll make adapting to bogus easier at least.
The mocking/expectation syntax we use is based on RR, not RSpec.
# bogus / RR syntax
expect(foo).to have_received.bar("hello")
# RSpec
expect(foo).to have_received(:bar).with("hello")
Adding an RSpec-syntax adapter is something we would like to add in the future - there's even some preliminary work done around that already, but at the moment it's a nice-to-have kind of thing. Check out issue #30 for more details.
The spy-syntax is:
RSpec's spies on the other hand work with
Keeping the latter in place after setting up bogus basically breaks spy-expectations without warning or any helpful message. What I did get was this:
Didn't know what was wrong. So there are two issues, basically:
It took some guesswork and granular comparison between examples is the GitHub README and my code to find out the error was on my side in the first place. Relishapp.com examples sport
should
syntax only.