I don't work in Ruby day-to-day, but I'm attempting to brush up on it. On exercism.io, there's an exercise I'm attempting to complete and the solution I came up with isn't working. Here's the test code:
class ResistorColorDuoTest < Minitest::Test
def test_brown_and_black
# skip
assert_equal 10, ResistorColorDuo.value(["brown", "black"])
end
end
This is the solution I came up with:
module ResistorColorDuo
def self.value(colors)
case colors
when (colors - ["brown", "black"]).empty?
10
else
-1
end
end
end
The output from the method is -1. I can't figure out what I've fouled up. Any suggestions are greatly appreciated. Thank you for reading.