Mockingbird v0.1.0 Mockingbird.Client

Set of helpers to be used in the module that contains the mocked respnoses.

Summary

Functions

Returns {:ok, response} if an :ok is passed as a first parameter, or {:error, exception} if :error is passed

Functions

respond(result, status, body, headers \\ [])

Returns {:ok, response} if an :ok is passed as a first parameter, or {:error, exception} if :error is passed.

# test/support/git_mock_http_client.ex
defmodule MyApp.GitMockHttpClient do
  use Mockingbird.FakeClient

  def call(:get, "https://api.github.com/users/amencarini") do
    respond :ok, 200, """
    {
      "login": "amencarini",
      "id":1100003
    }
    """
  end
end