View Source wait_helper (wait_helper v0.2.0)

Summary

Functions

Waits TimeLeft for Fun to return ExpectedValue

Functions

Link to this function

wait_until(Fun, ExpectedValue)

View Source

See also: wait_until/3.

Link to this function

wait_until(Fun, ExpectedValue, Opts)

View Source

Waits TimeLeft for Fun to return ExpectedValue

If the result of Fun matches ExpectedValue, returns {ok, ExpectedValue}

If no value is returned or the result doesn't match ExpectedValue, returns one of the following:

  • {Name, History}, if #{name => Name} is is passed in the Opts
  • {timeout, History} otherwise
  • Example: wait_until(fun () -> ... end, SomeVal, #{time_left => timer:seconds(2)})