View Source Zest.Faking (bonfire v0.3.5-classic-beta.7)

Helpers to make random generator functions more useful in tests

Link to this section Summary

Functions

Partner to unused. Adds a list of values to the list of used values under a key.

Returns the next unused integer id for name starting from start. Permits jumping by artificially increasing start - if start is higher than the last used id, it will return start and set it as the last used id

Reruns a faker until a predicate passes. Default limit is 10 tries.

Reruns a faker until an unseen value has been generated. Default limit is 10 tries. Stores seen things in the process dict (yes, that process dict)

Link to this section Functions

Partner to unused. Adds a list of values to the list of used values under a key.

Returns the next unused integer id for name starting from start. Permits jumping by artificially increasing start - if start is higher than the last used id, it will return start and set it as the last used id

Link to this function

such_that(faker, name, test, limit \\ 10)

View Source

Reruns a faker until a predicate passes. Default limit is 10 tries.

Link to this function

unused(faker, name, limit \\ 10)

View Source

Reruns a faker until an unseen value has been generated. Default limit is 10 tries. Stores seen things in the process dict (yes, that process dict)