double v0.2.3 Double

Double is a simple library to help build injectable dependencies for your tests. It does NOT override behavior of existing modules or functions.

Summary

Functions

Adds a stubbed function to the given map or struct. Structs will only work if they contain the key given for function_name

Returns a map that can be used to setup stubbed functions

Same as double/0 but returns the same map or struct given

Types

option()
option ::
  {:with, [...]} |
  {:returns, any} |
  {:raises, String.t | {atom, String.t}}

Functions

allow(dbl, function_name, opts)
allow(map | struct, atom, [option]) :: map | struct

Adds a stubbed function to the given map or struct. Structs will only work if they contain the key given for function_name.

double()
double() :: map

Returns a map that can be used to setup stubbed functions.

double(struct_or_map)
double(map | struct) :: map | struct

Same as double/0 but returns the same map or struct given