Module cuttlefish_unit

Support for unit testing.

Description

Support for unit testing.

Data Types

mustache_ctx()

mustache_ctx() = [mustache_def()]

mustache_def()

mustache_def() = {mustache_key(), mustache_val()}

mustache_key()

mustache_key() = atom() | binary() | string()

mustache_val()

mustache_val() = term()

Function Index

assert_config/3
assert_error/1Asserts that the generated configuration is in error.
assert_error/3Asserts that the generated configuration is in error, and the given error message was emitted by the given phase.
assert_error_in_phase/2Asserts that the generated configuration is in error, with the error occurring in a specific phase.
assert_error_message/2Asserts that the generated configuration is in error and contains an error tuple that translates to the given error message.
assert_errors/2Asserts that the generated configuration is in error and has the given error messages.
assert_errors/3Asserts that the generated configuration is in error, with errors occuring in the given phase and containing the given messages.
assert_not_configured/2
assert_valid_config/1
generate_config/2
generate_templated_config/3
generate_templated_config/4
lib_priv_dir/1Returns the path to an application's working "priv" directory.
lib_test_dir/1Returns the path to an application's working "test" directory.

Function Details

assert_config/3

assert_config(Config, Path, Value) -> any()

assert_error/1

assert_error(Config) -> any()

Asserts that the generated configuration is in error.

assert_error/3

assert_error(Config, Phase, Message) -> any()

Asserts that the generated configuration is in error, and the given error message was emitted by the given phase.

assert_error_in_phase/2

assert_error_in_phase(Config, Phase) -> any()

Asserts that the generated configuration is in error, with the error occurring in a specific phase.

assert_error_message/2

assert_error_message(Config, Message) -> any()

Asserts that the generated configuration is in error and contains an error tuple that translates to the given error message

assert_errors/2

assert_errors(Config, Messages) -> any()

Asserts that the generated configuration is in error and has the given error messages.

assert_errors/3

assert_errors(Config, Phase, Messages) -> any()

Asserts that the generated configuration is in error, with errors occuring in the given phase and containing the given messages.

assert_not_configured/2

assert_not_configured(Config, Path) -> any()

assert_valid_config/1

assert_valid_config(Config) -> any()

generate_config/2

generate_config(SchemaFile::string(), Conf::list()) -> list()

generate_templated_config/3

generate_templated_config(FileName, Conf, Context) -> any()

generate_templated_config/4

generate_templated_config(FileName, Conf, Context, PreexistingSchema) -> any()

lib_priv_dir/1

lib_priv_dir(Module::module()) -> string() | false

Returns the path to an application's working "priv" directory.

Module MUST be compiled from a file in one of the application's main source directories, generally the project's "src" directory. Module's code IS NOT explicitly loaded by this operation.

The returned path is to the "priv" directory in the working instance of the application, which may be in a number of places in different Rebar versions.

false is returned if the path cannot be determined, or does not exist, or is not a directory.

Logically, this is analogous to
   filename:join(
       filename:dirname(filename:dirname(code:which(Module))),
       "priv" )

lib_test_dir/1

lib_test_dir(Module::module()) -> string() | false

Returns the path to an application's working "test" directory.

Module MUST be compiled from a file in one of the application's main source directories, generally the project's "src" directory. Module's code IS NOT explicitly loaded by this operation.

The returned path is to the "test" directory in the working instance of the application, which may be in a number of places in different Rebar versions.

false is returned if the path cannot be determined, or does not exist, or is not a directory.

Logically, this is analogous to
   filename:join(
       filename:dirname(filename:dirname(code:which(Module))),
       "test" )


Generated by EDoc