# `Storehouse.Test`
[🔗](https://github.com/hattoriai/storehouse/blob/v0.2.0/lib/storehouse/test.ex#L1)

Assertions on the files a test stored, with `Storehouse.Memory`:

    import Storehouse.Test

    test "an avatar is stored, and the old one deleted", %{user: user} do
      {:ok, user} = Accounts.update_avatar(user, upload)

      assert_stored user.avatar.key
      refute_stored "avatars/old.png"
      assert [%{key: "avatars/" <> _}] = stored_files()
    end

Each sees only the files of the calling test (see `Storehouse.Memory`'s
checkout).

# `assert_stored`

```elixir
@spec assert_stored(String.t() | Regex.t()) :: String.t()
```

Asserts that a file is stored under `key`, or under a key that matches a
regex. Gives the key.

# `refute_stored`

```elixir
@spec refute_stored(String.t() | Regex.t()) :: :ok
```

Asserts that no file is stored under `key`, or under a key that matches a regex.

# `stored_files`

```elixir
@spec stored_files() :: [map()]
```

The files stored, in the order of their keys: each with its `:key`, `:body`, `:content_type` and `:modified_at`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
