Giphy v0.1.1 Giphy.API.Mock

A mock version of the Giphy.API for use in tests. Use it instead of Giphy.API.HTTP in your tests:

# config/test.exs
config :giphy, api: Giphy.API.Mock

Then, perform requests against the mock:

Giphy.search("invalid_api_key")
Giphy.search("not_found")
Giphy.search("error")
Giphy.search("valid")

Make Your Own

If this mock does not suit your needs, define your own and use it instead:

defmodule MyApp.Giphy.Mock do
  @behaviour Giphy.API

  def get("/search", _headers, [{:params, params} | _]) do
    # ...
  end
end

# In your config/test.exs:
config :giphy, api: MyApp.Giphy.Mock

Summary

Functions

do_search(binary)
get(binary, headers, list)

Perform a mock search.

Supports the following search terms: