Permalink
Browse files

TEST check that we can return tagged values from the call handler

We can't ... reported by stwind in #20
  • Loading branch information...
1 parent 018bed8 commit 87fd80f8f92233e570e60d9a0bf0ecb4896d4c46 @samuelrivas committed Jul 30, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/unit/moka_call_handler_tests.erl
@@ -38,6 +38,14 @@ normal_return_test_() ->
[?_assertEqual(0, get_response([0, 1])),
?_assertEqual(6, get_response([2, 3]))]}.
+tagged_return_test_() ->
+ {setup,
+ fun() -> setup_handler(fun(X) -> X end) end,
+ fun cleanup_handler/1,
+ [?_assertEqual(ok , get_response([ok])),
+ ?_assertEqual({ok, foo} , get_response([{ok, foo}])),
+ ?_assertEqual({error, bar}, get_response([{error, bar}]))]}.
+
throw_test_() ->
{setup,
fun() -> setup_handler(fun erlang:throw/1) end,

0 comments on commit 87fd80f

Please sign in to comment.