aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.rb6
-rw-r--r--spec/player_spec.rb21
2 files changed, 25 insertions, 2 deletions
diff --git a/main.rb b/main.rb
index ea449b7..ad9eb72 100644
--- a/main.rb
+++ b/main.rb
@@ -2,11 +2,13 @@ require_relative 'board'
require_relative 'player'
board = Board.new
-player_1 = Player.new
-player_2 = Player.new
+player_1 = Player.new('X', board)
+player_2 = Player.new('O', board)
board.current_player = player_1
until board.winner
coordinates = gets.chomp
coordinates = board.transform_coordinates(coordinates)
+
+ board.current_player.move(coordinates)
end
diff --git a/spec/player_spec.rb b/spec/player_spec.rb
new file mode 100644
index 0000000..7456031
--- /dev/null
+++ b/spec/player_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+require 'board'
+require 'player'
+
+describe Player do
+ describe '#move' do
+ before do
+ board = Board.new
+ @player = Player.new('X', board)
+ end
+
+ it 'raises an ArgumentError given invalid coordinates' do
+ end
+
+ it 'adds a piece to the correct coordinates on `board`' do
+ end
+
+ it 'uses the correct insignia for the move' do
+ end
+ end
+end