Mockingbird v0.2.0 Mockingbird.Client
Set of helpers to be used in the module that contains the mocked respnoses.
Link to this section Summary
Functions
Returns {:ok, response} if an :ok is passed as a first parameter, or
{:error, exception} if :error is passed
Link to this section Functions
Link to this function
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
import Mockingbird.Client
def call(:get, "https://api.github.com/users/amencarini") do
respond :ok, 200, """
{
"login": "amencarini",
"id":1100003
}
"""
end
end