test/test_rps.rb in PlayRockPaperScissorsGame-2.2.3 vs test/test_rps.rb in PlayRockPaperScissorsGame-2.2.4
- old
+ new
@@ -75,9 +75,16 @@
if Constants::NTRY_TO_SYM.key?(choice)
return Constants::NTRY_TO_SYM[choice]
elsif choice != Constants::VALID_ENTRIES
puts ColorizedString["That entry is invalid. Please re-enter"].colorize(:green)
end
+ # # one may also do this:
+ # case
+ # when Constants::NTRY_TO_SYM.key?(choice)
+ # return Constants::NTRY_TO_SYM[choice]
+ # when choice != Constants::VALID_ENTRIES
+ # puts ColorizedString["That entry is invalid. Please re-enter."].colorize(:green)
+ # end
end
end
def player_outcome(plays)
return :WIN if Constants::WINNERS.include?(plays)
return :LOSE if Constants::LOSERS.include?(plays)