Sha256: 73d7e81b025c977f9bb447e211f466e9407627d849138f56573a7b3e9702718b

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

require 'spec_helper'

describe 'Players::Computer' do
  it 'inherits from Player' do
    expect(Players::Computer.ancestors).to include(Player)
  end

  describe '#move' do
    it 'returns a valid position for the computer to move' do
      computer = Players::Computer.new("X")
      board = Board.new

      valid_moves = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]

      computer_move = computer.move(board)

      expect(valid_moves).to include(computer_move)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tictactoe_tracypholmes-0.1.3 spec/05_computer_player_spec.rb