Fix GH-30; passthrough not accepting different arguments
diff --git a/src/meck.app.src b/src/meck.app.src
index 50deec1..2e6648f 100644
--- a/src/meck.app.src
+++ b/src/meck.app.src
@@ -1,7 +1,7 @@
%% -*- mode: erlang; -*-
{application, meck,
[{description, "A mocking framework for Erlang"},
- {vsn, "0.7"},
+ {vsn, "0.7.1"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib]},
diff --git a/src/meck.erl b/src/meck.erl
index 788a869..9a896d1 100644
--- a/src/meck.erl
+++ b/src/meck.erl
@@ -539,10 +539,10 @@
% exception created with the mock:exception function,
% do not invalidate Mod
raise(Mod, Func, Args, Class, Reason);
- {passthrough, Args} ->
+ {passthrough, PassthroughArgs} ->
% call_original(Args) called from mock function
- Result = apply(original_name(Mod), Func, Args),
- cast(Mod, {add_history, {{Mod, Func, Args}, Result}}),
+ Result = apply(original_name(Mod), Func, PassthroughArgs),
+ cast(Mod, {add_history, {{Mod, Func, PassthroughArgs}, Result}}),
Result
end.
diff --git a/test/meck_tests.erl b/test/meck_tests.erl
index cdf39f2..92bb929 100644
--- a/test/meck_tests.erl
+++ b/test/meck_tests.erl
@@ -479,6 +479,13 @@
?assertEqual({1, 2}, meck_test_module:c(1, 2)),
ok = meck:unload(meck_test_module).
+passthrough_different_arg_test() ->
+ ok = meck:new(meck_test_module),
+ ok = meck:expect(meck_test_module, c,
+ fun(_, _) -> meck:passthrough([x, y]) end),
+ ?assertEqual({x, y}, meck_test_module:c(1, 2)),
+ ok = meck:unload(meck_test_module).
+
cover_test() ->
{ok, _} = cover:compile("../test/meck_test_module.erl"),
a = meck_test_module:a(),