--- a/test/rps3_tests.erl Sat Mar 08 23:40:26 2014 +0900
+++ b/test/rps3_tests.erl Sat Mar 08 23:45:03 2014 +0900
+-import(rps3, [get_hands/0, winning_hand/1, why/2]).
-include_lib("eunit/include/eunit.hrl").
- ?assertEqual(3, length(rps3:get_hands())).
+ ?assertEqual(3, length(get_hands())).
- ?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])).
+ ?assertEqual(paper, winning_hand([rock, paper])),
+ ?assertEqual(scissors, winning_hand([paper, scissors])),
+ ?assertEqual(rock, winning_hand([scissors, rock])),
+ ?assertEqual(rock, winning_hand([rock, rock, rock])),
+ ?assertEqual(undefined, winning_hand([rock, paper, scissors])),
+ ?assertEqual(paper, winning_hand([rock, paper, paper])),
+ ?assertEqual(paper, winning_hand([rock, rock, paper])).
- ?assertEqual("crushes", rps3:why(rock, scissors)),
- ?assertEqual("paper covers rock", rps3:why(paper, [rock])).
+ ?assertEqual("crushes", why(rock, scissors)),
+ ?assertEqual("paper covers rock", why(paper, [rock])).
--- a/test/rps5_tests.erl Sat Mar 08 23:40:26 2014 +0900
+++ b/test/rps5_tests.erl Sat Mar 08 23:45:03 2014 +0900
+-import(rps5, [get_hands/0, winning_hand/1, why/2]).
-include_lib("eunit/include/eunit.hrl").
- ?assertEqual(5, length(rps5:get_hands())).
+ ?assertEqual(5, length(get_hands())).
- ?assertEqual(paper, rps5:winning_hand([rock, paper])),
- ?assertEqual(scissors, rps5:winning_hand([paper, scissors])),
- ?assertEqual(rock, rps5:winning_hand([scissors, rock])),
- ?assertEqual(rock, rps5:winning_hand([rock, rock, rock])),
- ?assertEqual(undefined, rps5:winning_hand([rock, paper, scissors])),
- ?assertEqual(paper, rps5:winning_hand([rock, paper, paper])),
- ?assertEqual(paper, rps5:winning_hand([rock, rock, paper])).
+ ?assertEqual(paper, winning_hand([rock, paper])),
+ ?assertEqual(scissors, winning_hand([paper, scissors])),
+ ?assertEqual(rock, winning_hand([scissors, rock])),
+ ?assertEqual(rock, winning_hand([rock, rock, rock])),
+ ?assertEqual(undefined, winning_hand([rock, paper, scissors])),
+ ?assertEqual(paper, winning_hand([rock, paper, paper])),
+ ?assertEqual(paper, winning_hand([rock, rock, paper])).
- ?assertEqual("smashes", rps5:why(spock, scissors)),
- ?assertEqual("lizard poisons spock, eats paper", rps5:why(lizard, [spock, paper])).
+ ?assertEqual("smashes", why(spock, scissors)),
+ ?assertEqual("lizard poisons spock, eats paper", why(lizard, [spock, paper])).