Is there a way to stub method for only specific arguments. Something like this
boss.stub(:fire!).with(employee1).and_return(true)
If any other
You can try write your own stubbing method, with code like this
fire_method = boss.method(:fire!) boss.stub!(:fire!) do |employee| if employee == employee1 true else fire_method.call(*args) end end