anchor.diff:  -author('cliff@powerset.com').
   
   %% API
  --export([mock/1, proxy_call/2, proxy_call/3, expects/4, expects/5, verify/1, stop/1]).
  +-export([mock/1, proxy_call/2, proxy_call/3, expects/4, expects/5, verify/1, stub_proxy_call/3, stub_function/4, stop/1]).
   
   -include("common.hrl").
   -include_lib("eunit/include/eunit.hrl").
  
positive.code: %% @end
  proxy_call(Module, Function, Args) ->
    gen_server:call(mod_to_name(Module), {proxy_call, Function, Args}).
    
  %% @spec expects(Module::atom(), 
  %%               Function::atom(), 
  
negative.code:     _ -> Acc
    end.
    
  stub_function_loop(Fun) ->
    receive
      {Ref, Pid, Args} ->
        ?debugFmt("received {~p,~p,~p}", [Ref, Pid, Args]),
        Ret = (catch Fun(Args) ),
        ?debugFmt("sending {~p,~p}", [Ref,Ret]),
        Pid ! {Ref, Ret},
        stub_function_loop(Fun)
    end.
  
  % Function -> {function, Lineno, Name, Arity, [Clauses]}
  % Clause -> {clause, Lineno, [Variables], [Guards], [Expressions]}
  % Variable -> {var, Line, Name}
  