In my class, I have a method. In the else block, it puts out a message "A number you typed isn't even on the card..." and a copy of the card.
def is_input_valid?(input)
if current_card.include?(input.first) && current_card.include?(input.last)
true
else
puts "A number you typed isn't even on the card..."
p current_card
false
end
end
In my test, I purposely make the method go to the else block and it passes.
it "returns false if input contains ANY numbers NOT from the current_card" do
allow(deck).to receive(:gets) {"99/99"}
deck.get_player_input
expect(deck.is_input_valid?(deck.player_input)).to be(false)
end
On my console, I get this:
...............A number you typed isn't even on the card...
[6, 6, 6, 6]
.
Finished in 0.026 seconds (files took 0.62704 seconds to load)
16 examples, 0 failures
The test passes but I don't want to see the bit. How do I get rid of it?
...............A number you typed isn't even on the card...
[6, 6, 6, 6]