-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor tests #22
Labels
Comments
Don't beat me but would it be so bad to do the "meck:expect" in each test itself respectively? katt_run_basic(lhttpc_request) ->
fun( "http://127.0.0.1/step1" = _Url
, "POST" = _Method
, _Headers
, _Body
, _Timeout
, _Options
) ->
{ok, { {201, []}
, [ {"Location", "http://127.0.0.1/step2"}
, {"Cache-Control", "no-cache"}
, {"Cache-Control", "no-store"}
, {"Cache-Control", "must-revalidate"}
, {"X-Another-Duplicate-Header", "foo"}
, {"X-Another-Duplicate-Header", "bar"}
]
, <<>>}}
end;
katt_run_basic(katt_blueprint_parse_file) ->
fun("/mock/basic.apib") ->
katt_blueprint_parse:string(
<<"--- Test 1 ---
---
Some description
---
# Step 1
The merchant creates a new example object on our server, and we respond with
the location of the created example.
POST /step1
> Accept: application/json
> Content-Type: application/json
{
\"cart\": {
\"items\": [
{
\"name\": \"Horse\",
\"quantity\": 1,
\"unit_price\": 4495000
},
[...]
HEAD /step5
< 404
< Content-Type: text/html
<<<
>>>
"/utf8>>)
end;
katt_run_basic(test) ->
fun() ->
meck:expect(lhttpc, request, katt_run_basic(lhttpc_request)),
meck:expect(katt_blueprint_parse, file, katt_run_basic(katt_blueprint_parse_file)),
Scenario = "/mock/basic.apib",
?_assertMatch( { pass
, Scenario
, _
, _
, [ {_, _, _, _, pass}
, {_, _, _, _, pass}
, {_, _, _, _, pass}
, {_, _, _, _, pass}
, {_, _, _, _, pass}
]
}
, katt:run(Scenario)
)
end. |
ah, uh, oh - just forget about this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to get around these annoyances:
The text was updated successfully, but these errors were encountered: