View Source MockMe.State (MockMe v0.2.3)
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)
.