View Source EfxCase.Mock.MockedFun (Efx v0.1.7)

Internal logic of a mocked function.

A mocked functions consists of the following:

  • the name or identifier of the function
  • the arity of the function
  • the implementation/replacement of the function. Besides an anonymous function this can be :unmocked or :default. :unmocked says there is no replacement yet and error when called :default refers to the default implementation
  • a number of expected calls
  • a counter showing how the mocked functions has been called

Summary

Types

@type t() :: %EfxCase.Mock.MockedFun{
  arity: arity() | nil,
  impl: ((... -> any()) | :unmocked | :default) | nil,
  name: atom() | nil,
  num_calls: non_neg_integer(),
  num_expected_calls: (non_neg_integer() | nil) | nil
}

Functions

Link to this function

limit_reached?(mocked_fun)

View Source
@spec limit_reached?(t()) :: boolean()
@spec satisfied?(t()) :: boolean()