anchor.diff:           , Result
            ]).
   
  +substitute(Bin) ->
  +  Vars = get(),
  +  substitute(Bin, Vars).
  +
   substitute(Bin, [])         -> Bin;
   substitute(Bin, [{K, V}|T]) -> substitute(substitute(Bin, K, V), T).
   
  -substitute(Bin, K, V) ->
  -  re:replace(Bin, ?SUB_BEGIN_TAG ++ to_list(K) ++ ?SUB_END_TAG,
  -             to_list(V), [{return, binary}, global]).
  +substitute(Bin, K0, V) ->
  +  ?VAR_PREFIX ++ K1 = to_list(K0),
  +  K = ?RECALL_BEGIN_TAG ++ K1 ++ ?RECALL_END_TAG,
  +  re:replace(Bin, K, to_list(V), [{return, binary}, global]).
   
   %%%_* Validation -------------------------------------------------------
   validate(E = #katt_response{}, A = #katt_response{}) ->
  
positive.code: -include("blueprint_types.hrl").
  
  %%%_* Defines ==========================================================
  -define(KEY_PREFIX,        "katt_").
  -define(EXTRACT_BEGIN_TAG, "{{<").
  -define(EXTRACT_END_TAG,   "}}").
  -define(STORE_BEGIN_TAG,   "{{>").
  -define(STORE_END_TAG,     "}}").
  -define(MATCH_ANY,         "{{_}}").
  -define(SUB_BEGIN_TAG,     "{{>").
  -define(SUB_END_TAG,       "<}}").
  -define(SCENARIO_TIMEOUT,  120000).
  -define(REQUEST_TIMEOUT,   20000).
  
  
negative.code: -spec run(string(), list(), list()) ->
               [{string(), pass|{fail, {atom(), any()}}}|{error, any()}].
  %% @doc Run test scenario. Argument is the full path to the scenario file.
  %% Last argument is a key-value list of parameters.
  %% @end
  run(Scenario, Params, Vars) ->
    spawn_link(?MODULE, run, [self(), Scenario, Params, Vars]),
    receive {done, Result}    -> Result
    after   ?SCENARIO_TIMEOUT -> {error, timeout}
    end.
  
  %%%_* Internal export --------------------------------------------------
  %% @private
  run(From, Scenario, Params, Vars) ->
    {ok, Blueprint} = katt_blueprint_parse:file(Scenario),
    From ! {done, run_scenario(Scenario, Blueprint, Params, Vars)}.
  
  %%%_* Internal =========================================================
  run_scenario(Scenario, Blueprint, Params, Vars) ->
    [put_var(Key, Value) || {Key, Value} <- Vars],
    run_operations( Scenario
                , Blueprint#katt_blueprint.operations
                , Params
                , []
                ).
  
  run_operations( Scenario
                , [#katt_operation{ description=Description
                                  , request=Req
                                  , response=Rsp
                                  }|T]
                , Params
                , Acc
                ) ->
    Request          = make_request(Req, Params),
    ExpectedResponse = make_response(Rsp),
    ActualResponse   = request(Request),
    case Result = validate(ExpectedResponse, ActualResponse) of
      pass -> run_scenario( Scenario
                          , T
                          , Params
                          , [{Request, Result}|Acc]
                          );
      _    -> dbg( Scenario
  