anchor.diff:           "Actual response:~n~p~n",
            [ReqFile, Request, ExpResponse, ActualResponse]).
   
  -read_request(RequestFile, DefaultHost, Params) ->
  +read_request(RequestFile, Request, Params) ->
     Data    = parse_file(RequestFile, Params),
     Headers = lk("headers", Data),
     RawBody = read_body(RequestFile, Params),
  -  #request{ url      = lk("url", Data)
  -          , host     = lk("host", Data, DefaultHost)
  -          , port     = lk("port", Data)
  -          , ssl      = lk("ssl", Data)
  -          , path     = lk("path", Data)
  -          , method   = lk("method", Data)
  +  #request{ url      = lk(url, Request, lk("url", Data))
  +          , host     = lk(host, Request, lk("host", Data))
  +          , port     = lk(port, Request, lk("port", Data))
  +          , ssl      = lk(ssl, Request, lk("ssl", Data))
  +          , path     = lk(path, Request, lk("path", Data))
  +          , method   = lk(method, Request, lk("method", Data))
             , headers  = Headers
             , body     = maybe_parse_body(Headers, RawBody)
             , raw_body = RawBody
  
positive.code:                       | {error, any()}].
  %% @doc Run test scenario. Argument is the full path to the testcase dir.
  %% @end
  run(TestcaseDir) -> run(TestcaseDir, "127.0.0.1").
  
  -spec ?MODULE:run(string(), string()) ->
                       [{string(), pass | {fail, {atom(), any()}}}
                        | {error, any()}].
  %% @doc Run test scenario. Argument is the full path to the testcase dir.
  %% @end
  run(TestCaseDir, DefaultHost) -> run(TestCaseDir, DefaultHost, []).
  
  -spec ?MODULE:run(string(), string(), list()) ->
                       [{string(), pass | {fail, {atom(), any()}}}
                        | {error, any()}].
  %% @doc Run test scenario. Argument is the full path to the testcase dir.
  %% Last argument is a key-value list of substitute parameters.
  %% @end
  run(TestcaseDir, DefaultHost, Params) ->
    spawn_link(?MODULE, run_test, [self(), TestcaseDir, DefaultHost, Params]),
    receive {done, Result}    -> Result
    after   ?TESTCASE_TIMEOUT -> {error, testcase_timeout}
    end.
  
negative.code:   ResponseFiles = get_files(Dir, "response"),
    lists:zip(RequestFiles, ResponseFiles).
  
  run_scenario(S, Request, Params) ->
    run_scenario(S, Request, Params, []).
  
  run_scenario([], _Request, _Params, Acc)                    ->
    lists:reverse(Acc);
  run_scenario([{ReqFile, RespFile}|T], Request, Params, Acc) ->
    Request        = read_request(ReqFile, Request, Params),
    ExpResponse    = read_response(RespFile, Params),
    ActualResponse = make_request(Request),
    case Result = validate_response(ExpResponse, ActualResponse) of
      pass -> ok;
      _    -> print_debug(ReqFile, Request, ExpResponse, ActualResponse)
    end,
    run_scenario(T, Request, Params, [{ReqFile, Result} | Acc]).
  
  print_debug(ReqFile, Request, ExpResponse, ActualResponse) ->
    ct:pal("~p:~n~p~n~n"
  