# AssertEventually

Very simple test helper for Elixir's ExUnit framework that allows to use standard ExUnit assertions along with expressions that may
fail several times until they **eventually** succeed.

## Documentation

Documentation can be found on [](

## Installation

The package can be installed by adding `assert_eventually` to your list of dependencies in `mix.exs`:

def deps do
    {:assert_eventually, "~> 0.2.0", only: :test}

## Just tell me how to use it already...

Here you go (just replace `ComplexSystem` with something of yours):

defmodule MyApp.SomeTest do
  use ExUnit.Case, async: true

  # Fail after 50ms of retrying with 5ms time between attempts
  use AssertEventually, timeout: 50, interval: 5

  test "get meaningful value by using normal assert" do
    {:ok, server_pid} = start_supervised(ComplexSystem)

    eventually assert {:ok, value} = ComplexSystem.get_value(server_pid)
    assert value == 42

  test "get meaningful value by using assert_in_delta" do
    {:ok, server_pid} = start_supervised(ComplexSystem)

    eventually assert_in_delta 42, elem(ComplexSystem.get_value(server_pid), 1), 0

For more details please consult the [documentation](