lib/mastermind/game/piece.rb in mastermind-game-0.0.1 vs lib/mastermind/game/piece.rb in mastermind-game-0.0.2
- old
+ new
@@ -4,10 +4,10 @@
COLORS = [:red, :green, :blue, :yellow, :white, :black]
attr_reader :color
def initialize(color: COLORS.sample)
- raise ArgumentError.new("Invalid color.") unless COLORS.include?(color)
+ raise ArgumentError.new("Invalid color: #{color}.") unless COLORS.include?(color)
@color = color
end
def ==(piece)
piece.is_a?(Piece) && color == piece.color