Skip to content
Adam Lindberg edited this page Nov 21, 2016 · 11 revisions

Welcome to the meck wiki!

Basic Tutorial - A basic tutorial on how to use meck

Release notes

Feature ideas

  • Mock a module only from the perspective of a specific caller (calling process) (#3)

    It should be possible to mock a module so that a set of processes sees the mocked module and all other processes sees the original module.

    • mock:new(mymod, [{restrict, pid()}]):
      • only the caller pid() would hit the mocked module
    • or even better, all pids belonging to a specific application
    • Would enable mocking of the inet, gen_tcp modules etc
  • meck:app (#16)

    This is a feature request for an new function which mocks an application so that you don't have to start all application dependencies when testing an application. i.e.

      meck:app(stdlib).
      ok = application:start(ssl).
    
  • Mock a module only from the perspective of a specific module (#34)

    It should be possible to mock a module only from the perspective of another specific module. This would allow mocking the file module for example, which is not possible due to its use from the code module (resulting in a crash when replacing the module).

  • Add meck:get_state/0, meck:reset_state/0 (#125)

    Export and import of mock states to speed up testing/compilation/runtimes. Needs research!

Clone this wiki locally