MockMe.State (MockMe v0.1.1) View Source

Used to keep track of state for mocks in tests. Holds a map of route names and response flags which the server uses to determine which response to serve.

Example

%{
  routes: [
    %MockMe.Route{
      name: :test_me,
      path: "/test-path",
      responses: [
        %MockMe.Response{flag: :success, body: "test-body"},
        %MockMe.Response{flag: :failure, body: "test-failure-body"}
      ]
    }
  ],
  cases: %{
    test_me: :success
  }
}

These values are populated from MockMe.add_routes/1 and then toggled using MockMe.set_response(:route_name, :route_flag).

Link to this section Summary

Link to this section Functions