Avrora.TestCase (avrora v0.23.0) View Source

An ExUnit helper.

Link to this section Summary

Functions

A hook function to be used in setup-hook to clean memory storage.

Link to this section Functions

Link to this function

cleanup_storage!(context \\ %{})

View Source

A hook function to be used in setup-hook to clean memory storage.

## Examples:

  defmodule MyTest do
    use ExUnit.Case, async: true

    import Avrora.TestCase
    setup :cleanup_storage!

    test "memory storage was filled" do
      asset Avrora.Storage.Memory.get("some") == nil

      Avrora.Storage.Memory.put("some", 42)
      asset Avrora.Storage.Memory.get("some") == 42
    end

    test "memory storage is clean" do
      asset Avrora.Storage.Memory.get("some") == nil
    end
  end