Skip to content

Commit

Permalink
Added first test
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminplee committed Jul 22, 2011
1 parent 05ed3df commit 1a7a9ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/calculator_app.erl
Expand Up @@ -5,6 +5,9 @@
%% Application callbacks
-export([start/2, stop/1]).

%% API
-export([add/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================
Expand All @@ -14,3 +17,6 @@ start(_StartType, _StartArgs) ->

stop(_State) ->
ok.

add([First, Second]) ->
First + Second.
8 changes: 8 additions & 0 deletions src/calculator_app_tests.erl
@@ -0,0 +1,8 @@
-module(calculator_app_tests).

-compile([export_all]).

-include_lib("eunit/include/eunit.hrl").

addition_test() ->
?assertEqual(4, calculator_app:add([2, 2])).

0 comments on commit 1a7a9ba

Please sign in to comment.