Commits

Anton Shestakov committed 1cda561

EUnit's assertEqual takes Expect first.

Comments (0)

Files changed (1)

test/rps3_tests.erl

 -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])).