ex_machina v2.0.0 ExMachina.Sequence

Summary

Functions

Reset all sequences so that the next sequence starts from 0

Functions

reset()

Reset all sequences so that the next sequence starts from 0

Example

ExMachina.Sequence.next("joe") # "joe0"
ExMachina.Sequence.next("joe") # "joe1"

Sequence.reset

ExMachina.Sequence.next("joe") # resets so the return value is "joe0"

If you want to reset sequences at the beginning of every test, put it in a setup block in your test.

setup do

 ExMachina.Sequence.reset

end

start_link()