さて、私は自分のプレイメソッドの仕様を書いています...これは次のようになります...
def play
#draw the board
puts drawgrid
#make a move
turn = 0
9.times do
if turn.even?
@player = @player_h.move_human("X", @board)
@move = @player.to_sym
@marker = @player_h.boardpiece
does_move_exist(@move,@marker)
is_a_human_win
else
@player = @player_c.move_computer("O", @board)
@move = @player
@marker = @player_c.boardpiece
does_move_exist(@move,@marker)
is_a_computer_win
end
puts drawgrid
turn += 1
end
end
私のスペックは現在このように見えます...
describe 'play method'do
it 'draws game board to screen' do
@game.play.should_receive(:puts) == <<-EOF.gsub(/^ {6}/, '')
a | |
----------
b | |
----------
c | |
----------
1 2 3
EOF
end
end
しかし、私が得ているエラーはこれです...。
1) Game class play method draws game board to screen
Failure/Error: @game.play.should_receive(:puts) == <<-EOF.gsub(/^ {6}/, '')
Errno::EISDIR:
Is a directory - spec
RSpecが私に何を言っているのかわからない。再生メソッドがドローグリッドを「置く」ことをテストするにはどうすればよいですか?