Kale
Basic given-when-then steps for ExUnit tests. This is currently little more than a spike: it's probably not ready to use, and the API is certainly not stable.
Features
- define tests as sequences of calls to
given_
,when_
andthen_
(unfortunatelywhen
is a reserved word) - match steps by calling
defwhen
etc with a string matching the one used in the step interpolate values into step descriptions using {braces}
- placeholder variable names are available as methods on the magic
args
variable
- placeholder variable names are available as methods on the magic
pass data between steps by calling
save
andget
with a key- data is stored in a per-test Agent, allowing tests to run in parallel
TODO
Remove the magic
args
, andsave
&get
- Pass args and context via arguments to
defwhen
etc - Allow pattern matching
- Return values to be saved from the function
- Pass args and context via arguments to
Usage
See the tests for examples.
Why Kale?
As a nod to Spinach.