elixir_script v0.32.1 ElixirScript.Test.Assertions View Source

Defines assertions for use in ElixirScript test. These are a subset of ExUnit.Assertions

Link to this section Summary

Functions

Asserts its argument is a truthy value

Asserts value is true, displaying the given message otherwise

Asserts that value1 and value2 differ by no more than delta

Asserts the exception is raised during function execution. Returns the rescued exception, fails otherwise

Asserts the exception is raised during function execution with the expected message, which can be a Regex or an exact String. Returns the rescued exception, fails otherwise

Fails with a message

A negative assertion, expects the expression to be false or nil

Asserts value is nil or false (that is, value is not truthy)

Asserts that value1 and value2 are not within delta

Link to this section Functions

Link to this macro assert(assertion) View Source (macro)

Asserts its argument is a truthy value

Link to this macro assert(value, message) View Source (macro)

Asserts value is true, displaying the given message otherwise.

Link to this macro assert_in_delta(value1, value2, delta, message \\ nil) View Source (macro)

Asserts that value1 and value2 differ by no more than delta

Link to this macro assert_raise(exception, function) View Source (macro)

Asserts the exception is raised during function execution. Returns the rescued exception, fails otherwise.

Link to this macro assert_raise(exception, message, function) View Source (macro)

Asserts the exception is raised during function execution with the expected message, which can be a Regex or an exact String. Returns the rescued exception, fails otherwise.

Link to this macro flunk(message \\ "Flunked!") View Source (macro)

Fails with a message.

Link to this macro refute(assertion) View Source (macro)

A negative assertion, expects the expression to be false or nil.

Link to this macro refute(value, message) View Source (macro)

Asserts value is nil or false (that is, value is not truthy).

Link to this macro refute_in_delta(value1, value2, delta, message \\ nil) View Source (macro)

Asserts that value1 and value2 are not within delta