View Source Repatch (Repatch v0.0.1)

Final word in Elixir testing

Summary

Types

@type allow_option() :: {:force, boolean()}
@type called_check_option() ::
  {:by, pid() | :any}
  | {:at_least, :once | pos_integer()}
  | {:exactly, :once | pos_integer()}
  | {:after, monotonic_time_native :: integer()}
  | {:before, monotonic_time_native :: integer()}
@type fake_option() :: recompile_option() | {:mode, mode()}
@type mode() :: :local | :shared | :global
@type patch_option() ::
  recompile_option() | {:mode, :local | :shared | :global} | {:force, boolean()}
@type recompile_option() :: {:ignore_forbidden_module, boolean()}
Link to this type

repatched_check_option()

View Source
@type repatched_check_option() :: {:mode, mode() | :any}
@type restore_option() :: {:mode, mode()}
@type setup_option() ::
  recompile_option()
  | {:enable_global, boolean()}
  | {:enable_shared, boolean()}
  | {:enable_history, boolean()}
  | {:recompile, module() | [module()]}
@type spy_option() :: recompile_option() | {:by, pid()}
@type tag() :: :patched | mode()

Functions

Link to this function

allow(owner, allowed, opts \\ [])

View Source
@spec allow(pid(), pid(), [allow_option()]) :: :ok
Link to this function

allowances(pid \\ self())

View Source
@spec allowances(pid()) :: [pid()]
Link to this function

called?(module, function, arity_or_args, opts \\ [])

View Source
@spec called?(module(), atom(), arity() | [term()], [called_check_option()]) ::
  boolean()
@spec cleanup(pid()) :: :ok
Link to this function

fake(real_module, fake_module, opts \\ [])

View Source
@spec fake(module(), module(), [fake_option()]) :: :ok
Link to this function

info(module, function, arity, pid \\ self())

View Source
@spec info(module(), atom(), arity(), pid()) :: [tag()]
@spec owner(pid()) :: pid() | nil
Link to this function

patch(module, function, opts \\ [], func)

View Source
@spec patch(module(), atom(), [patch_option()], function()) :: :ok
Link to this function

repatched?(module, function, arity, opts \\ [])

View Source
@spec repatched?(module(), atom(), arity(), [repatched_check_option()]) :: boolean()
Link to this function

restore(module, function, arity, opts \\ [])

View Source
@spec restore(module(), atom(), arity(), [restore_option()]) :: :ok
@spec restore_all() :: :ok
@spec setup([setup_option()]) :: :ok
@spec spy(module(), [spy_option()]) :: :ok