Well, you need help developing a test. I want to check that this class gets the letter "O" and that when the "move_computer" method is called, WHATEVER is returned when a person enters cli. my psychic subprocessor tells me that itβs just assigning a variable to something to keep a random human input into STDIN. You just wonβt get it right now ... are everyone pointing me in the right direction?
here is my class ...
class Player def move_computer(leter) puts "computer move" @move = gets.chomp return @move end end
my test looks like ...
describe "tic tac toe game" do context "the player class" do it "must have a computer player O" do player = Player.new() player.stub!(:gets) {"\n"} #FIXME - what should this be? STDOUT.should_receive(:puts).with("computer move") STDOUT.should_receive(:puts).with("\n") #FIXME - what should this be? player.move_computer("O") end end end
source share