lib/codebreaker_kirill/validations.rb in codebreaker_kirill-0.2.19 vs lib/codebreaker_kirill/validations.rb in codebreaker_kirill-0.2.20

- old
+ new

@@ -7,12 +7,12 @@ raise 'Name should be at least 3 characters long' if name.length < 3 raise "Name shouldn't be more than 20 characters long" if name.length > 20 end def self.validate_guess(guess) - raise "Name shouldn't be empty" if guess.empty? - raise 'Name should be at least 3 characters long' if guess.length < 4 - raise 'Name shouldn\'t be more than 4 characters long' if guess.length > 4 + raise "Guess shouldn't be empty" if guess.empty? + raise 'Guess should be at least 3 characters long' if guess.length < 4 + raise 'Guess shouldn\'t be more than 4 characters long' if guess.length > 4 end def self.validate_difficulty(difficulty) raise "Input shouldn't be empty" if difficulty.empty? return if difficulty.match?(/easy|medium|hell/)