mock matcher?
Closed this issue · 0 comments
youta-t commented
To test a func is invoked properly, mock is used.
Testing with mock is done by:
- check arguments are ok
- create (or inject) return value
- check if the func has been called (in a exact order)
Its may be able to help users task 1.
- write a code generator which generates...
- "argspec" (like structer's spec) from function arglist
- mock function factory receives "argspec" and return value factory, that mock does Match() on invocation.
To do that, refactoring structer may be needed.