Skip to content
nialscorva edited this page Jan 30, 2011 · 4 revisions

Basic Usage

All mock tests have the same basic form:

erlymock:start(),
erlymock:strict(module,function,[arg1,'_'],[{return,ok}]),
erlymock:stub(module,function2,[1,2,3],[{throw, myerror}]),

% initialize
erlymock:replay(),

% test
?assertMatches(ok,module:function(arg,anything)),
?assertThrow(myerror,module:function2(1,2,3)),
erlymock:verify().

Known issues

Documentation

See http://sheyll.blogspot.com/2009/02/erlang-mock-erlymock.html for origins, but really the only commonality is some of the module generation code.

Clone this wiki locally