ExStub v0.2.0 ExStub.Recorder

ExStub.Recorder Provides methods to record the function calls and provides a set of functions to query the recorded executions.

Summary

Functions

Get all the function calls on a specific module

Get all the function calls on a specific module that match a function name

Get all the function calls on a specific module that match a function name and list of params

Record a funtion call on a module with params

Start the recording session. (Not to be called manually)

Functions

calls(module)

Get all the function calls on a specific module.

Example

MyStub.func1
MyStub.func2

ExStub.Recorder.calls(MyStub)

This returns [func1: [], func2: []]

calls(module, function)

Get all the function calls on a specific module that match a function name.

Example

MyStub.func1([1])
MyStub.func2([1, 2])

ExStub.Recorder.calls(MyStub, :func2)

This returns [func1: [1]]

calls(module, function, params)

Get all the function calls on a specific module that match a function name and list of params.

Example

MyStub.func1([1])
MyStub.func1([2])

ExStub.Recorder.calls(MyStub, :func2, [1])

This returns [func1: [1]]

record_call(module, name, params)

Record a funtion call on a module with params.

start_recording()

Start the recording session. (Not to be called manually)