Sha256: 6c1cbdbd81e62c909d47ae6dc048089e8314f9f20abf80ba28c34ca80ff587e2

Contents?: true

Size: 410 Bytes

Versions: 1

Compression:

Stored size: 410 Bytes

Contents

require 'spec_helper'

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

  describe '#move' do
    it 'asks the user for input and returns it' do
      human = Players::Human.new("X")
      allow($stdout).to receive(:puts)

      expect(human).to receive(:gets).and_return("1")

      expect(human.move([])).to eq("1")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tictactoe_tracypholmes-0.1.3 spec/03_human_player_spec.rb