Ok I've been banging away it this problem for hours.
I am trying to mock out a call to a class and verify certain parameters match exactly, but not care about the others
So the class I am testing, lets call it SomethingElse
MyClass.new('SomeKey', 1234, Time.now)
So I have been doing this.
object = mock
test_obj = SomethingElse.new
This works fine, but I want my test to verify those first two parameters on MyClass.new. I know what they must be, the third can be anything(just picking Time.now to make that clear)
I tried something like this, of course anything didn;'t work there.
MyClass.expects(:new).with("SomeKey", 1234, anything).returns(object)
Reading more, I thought includes might help. I tried
But I got some error on converting integer to string. I've dug and tried all sorts of other things. I figure I am missing some simple aspect of this I am missing.
I am still pretty new to Mocha, so this is probably something dead simple...