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_(unfortunatelywhenis a reserved word) - match steps by calling
defwhenetc 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
argsvariable
- placeholder variable names are available as methods on the magic
pass data between steps by calling
saveandgetwith 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
defwhenetc - 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.