I want to ensure that my Foo.bar
method is called with true
at some point during my test. So far I've only been able to assert against the first call to Foo.bar
. I need to assert against any call.
This is what I have so far but doesn't work:
expect(Foo).to receive(:bar).at_least(:once).with("true")
Foo.bar("false")
Foo.bar("false")
Foo.bar("true")
Foo.bar("false")
It fails on the first Foo.bar
because "false" doesn't match my "true" expectation. How would you rewrite this to pass because Foo.bar("true")
is called at some point during the test?