ExExample (ExExample v0.1.2)

View Source

Documentation 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

dependency()

@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}

example()

@type example() :: {atom(), [dependency()]}

Functions

all_dependencies(arg)

@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).

example(arg, list)

(macro)

example?(arg)

@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.

example_dependencies(arg)

@spec example_dependencies({atom(), atom()}) :: [dependency()]

I return a list of example dependencies for this example. Note: this does not include other called modules.

example_module?(module)

@spec example_module?(atom()) :: boolean()

I return true if the given module contains examples.

execution_order(module)

@spec execution_order(atom()) :: [{atom(), atom()}]

I return a list of examples in the order they should be executed in.

I do this by topologically sorting their execution order.

hidden_name(arg)

@spec hidden_name({atom(), atom()}) :: {atom(), atom()}

I return the hidden name of an example. The hidden name is the example body without modification.