youta-t/its

mock matcher?

Closed this issue · 0 comments

To test a func is invoked properly, mock is used.

Testing with mock is done by:

  1. check arguments are ok
  2. create (or inject) return value
  3. 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.