ExExample (ExExample v0.1.2)
View SourceDocumentation for ExExample.
Summary
Types
A dependency is a function that will be called by an example.
The format of a dependency is {{module, function}, arity}
Functions
I return a list of all dependencies for this example. Note: this does includes other called modules too (e.g., Enum).
I determine if a module/function pair is an example or not.
I return a list of example dependencies for this example. Note: this does not include other called modules.
I return true if the given module contains examples.
I return a list of examples in the order they should be executed in.
I return the hidden name of an example. The hidden name is the example body without modification.
Types
@type dependency() :: {{atom(), atom()}, non_neg_integer()}
A dependency is a function that will be called by an example.
The format of a dependency is {{module, function}, arity}
@type example() :: {atom(), [dependency()]}
Functions
@spec all_dependencies({atom(), atom()}) :: [dependency()]
I return a list of all dependencies for this example. Note: this does includes other called modules too (e.g., Enum).
@spec example?(dependency()) :: boolean()
I determine if a module/function pair is an example or not.
A function is an example if it is defined in a module that has the __examples__/0 function
implemented, and when the __examples__() output lists that function name as being an example.
@spec example_dependencies({atom(), atom()}) :: [dependency()]
I return a list of example dependencies for this example. Note: this does not include other called modules.
I return true if the given module contains examples.
I return a list of examples in the order they should be executed in.
I do this by topologically sorting their execution order.