Finbarr
Finbarr

Reputation: 32126

Rspec stub expectation for an instance of a class

I want something like the following:

foo.should_receive(:bar).with(an_instance_of(Bla)).....

Is this possible?

Edit: According to the rspec message expectations page it is possible exactly as I have written above.

Upvotes: 2

Views: 286

Answers (1)

Finbarr
Finbarr

Reputation: 32126

The answer is that you can do exactly what I had hoped:

foo.should_receive(:bar).with(an_instance_of(Bla))

Upvotes: 1

Related Questions