Download:
child 40:7d4b76367349
parent 38:ec8d1ad0da1d
39:1cda561a868f
Anton Shestakov <engored@ya.ru>, Mon, 03 Mar 2014 20:22:21 +0900
EUnit's assertEqual takes Expect first.

1 файлов изменено, 8 вставок(+), 8 удалений(-) [+]
test/rps3_tests.erl file | annotate | diff | comparison | revisions
--- a/test/rps3_tests.erl Mon Mar 03 20:08:31 2014 +0900
+++ b/test/rps3_tests.erl Mon Mar 03 20:22:21 2014 +0900
@@ -2,13 +2,13 @@
-include_lib("eunit/include/eunit.hrl").
get_hands_test() ->
- ?assertEqual(length(rps3:get_hands()), 3).
+ ?assertEqual(3, length(rps3:get_hands())).
winning_hand_test() ->
- ?assertEqual(rps3:winning_hand([rock, paper]), paper),
- ?assertEqual(rps3:winning_hand([paper, scissors]), scissors),
- ?assertEqual(rps3:winning_hand([scissors, rock]), rock),
- ?assertEqual(rps3:winning_hand([rock, rock, rock]), rock),
- ?assertEqual(rps3:winning_hand([rock, paper, scissors]), undefined),
- ?assertEqual(rps3:winning_hand([rock, paper, paper]), paper),
- ?assertEqual(rps3:winning_hand([rock, rock, paper]), paper).
+ ?assertEqual(paper, rps3:winning_hand([rock, paper])),
+ ?assertEqual(scissors, rps3:winning_hand([paper, scissors])),
+ ?assertEqual(rock, rps3:winning_hand([scissors, rock])),
+ ?assertEqual(rock, rps3:winning_hand([rock, rock, rock])),
+ ?assertEqual(undefined, rps3:winning_hand([rock, paper, scissors])),
+ ?assertEqual(paper, rps3:winning_hand([rock, paper, paper])),
+ ?assertEqual(paper, rps3:winning_hand([rock, rock, paper])).