ex_machina v2.2.2 ExMachina.Sequence View Source
Module for generating sequential values.
Use ExMachina.sequence/1 or ExMachina.sequence/2 to generate
sequential values instead of calling this module directly.
Link to this section Summary
Link to this section Functions
Reset all sequences so that the next sequence starts from 0
Example
ExMachina.Sequence.next("joe") # "joe0"
ExMachina.Sequence.next("joe") # "joe1"
ExMachina.Sequence.reset
ExMachina.Sequence.next("joe") # resets so the return value is "joe0"
You can use list as well
ExMachina.Sequence.next(["A", "B"]) # "A"
ExMachina.Sequence.next(["A", "B"]) # "B"
Sequence.reset
ExMachina.Sequence.next(["A", "B"]) # resets so the return value is "A"
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