ESpec.Example
Defines macros ‘example’ and ‘it’. These macros defines function with random name which will be called when example runs. Example structs %ESpec.Example are accumulated in @examples attribute
Summary↑
__struct__() | Expampe struct. description - the description of example, function - random function name, file - spec file path, line - the line where example is defined, context - example context. Accumulator for ‘contexts’ and ‘lets’, success - store example result, result - the value returned by example block error - store an error |
example(list1) | Defines example without description |
example(description, list2) | Adds example to @examples and defines function to wrap the spec.
Sends ‘double underscore |
failed(results) | Filters failed examples |
full_description(example) | Description with contexts |
it(list1) | Alias for |
it(description, list2) | Alias for |
success(results) | Filters success examples |
Functions
Specs:
- __struct__ :: %ESpec.Example{context: term, description: term, error: term, file: term, function: term, line: term, result: term, success: term}
Expampe struct. description - the description of example, function - random function name, file - spec file path, line - the line where example is defined, context - example context. Accumulator for ‘contexts’ and ‘lets’, success - store example result, result - the value returned by example block error - store an error
Filters failed examples
Description with contexts.
Filters success examples
Macros
Defines example without description
Adds example to @examples and defines function to wrap the spec.
Sends ‘double underscore __
‘ variable to the example block.
Alias for example/1
Alias for example/2