Closed o-lim closed 9 years ago
This adds the returned_with assertion for spies.
returned_with
local spy.new(function() return 1, 2, 3 end) s() assert.spy(s).was.returned_with(1, 2, 3)
Also works with don't cares.
local spy.new(function() return 1, 2, 3 end) local _ = spy._ s() assert.spy(s).was.returned_with(1, _, 3)
Fix on_call_with to match against don't care arguments.
on_call_with
local test = {} local _ = stub._ stub(test, "key").on_call_with(_).returns("foo") assert.is_nil(test.key()) assert.is_nil(test.key(1, 2)) assert.is_equal("foo", test.key(1)) assert.is_equal("foo", test.key(2)) assert.is_equal("foo", test.key('a')) assert.is_equal("foo", test.key('b')) assert.is_equal("foo", test.key({}))
This adds the
returned_with
assertion for spies.Also works with don't cares.
Fix
on_call_with
to match against don't care arguments.