apocryphal v0.2.8 Apocryphal

Summary

Functions

Deserializes an HTTP Response

Examples

iex> Apocryphal.parse("./path/to/v1.yaml")

Serializes an HTTP Body

Get the full URL of the server under test

Functions

deserialize(body, mime)

Specs

deserialize(Map.t | List.t, String.t) :: String.t

Deserializes an HTTP Response

Example

  config :apocryphal,
    deserializers: %{
      "application/json" => fn(body) -> Poison.decode!(body) end
    }
dir()
expand(map)
parse(url)

Specs

parse(String.t) :: Map.t
parse(String.t) :: Map.t

Examples

iex> Apocryphal.parse("./path/to/v1.yaml")

iex> Apocryphal.parse("./path/to/v1.json")
serialize(body, mime \\ nil)

Specs

serialize(Map.t | List.t, String.t) :: String.t

Serializes an HTTP Body

Example

  config :apocryphal,
    serializers: %{
      "application/json" => fn(body) -> Poison.encode!(body) end
    }
url(path)

Specs

url(String.t) :: String.t

Get the full URL of the server under test.

Example

  config :apocryphal,
    port: 4001,
    host: "localhost"
url(host, port, path)