View Source Kale.Macros (kale v0.8.1)

Macros, automatically imported by use Kale.

Summary

Functions

Generate a step definition matching a particular string and optionally a context map. See the module documentation for usage examples.

Generate a feature block, which corresponds to an ExUnit describe.

Generate a scenario block, which corresponds to an ExUnit test.

Functions

Link to this macro

defgiven(step, context \\ {:%{}, [], []}, list)

View Source (macro)
@spec defgiven(String.t(), Macro.t(), [{:do, Macro.t()}]) :: Macro.t()

Generate a step definition matching a particular string and optionally a context map. See the module documentation for usage examples.

The given, when and then steps are actually interchangeable – the separate macros are provided for readability only.

Link to this macro

defthen(step, context \\ {:%{}, [], []}, list)

View Source (macro)
@spec defthen(String.t(), Macro.t(), [{:do, Macro.t()}]) :: Macro.t()

An alias for defgiven/2.

Link to this macro

defwhen(step, context \\ {:%{}, [], []}, list)

View Source (macro)
@spec defwhen(String.t(), Macro.t(), [{:do, Macro.t()}]) :: Macro.t()

An alias for defgiven/2.

Link to this macro

feature(name, list)

View Source (macro)
@spec feature(String.t(), [{:do, Macro.t()}]) :: Macro.t()

Generate a feature block, which corresponds to an ExUnit describe.

Link to this macro

scenario(name, body)

View Source (macro)
@spec scenario(String.t(), String.t()) :: Macro.t()

Generate a scenario block, which corresponds to an ExUnit test.