From da8707f50f40b325df86efaa26f821142c89662c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 14 Apr 2015 18:40:47 -0400 Subject: Flesh out the game loop * Use a new, currently empty `Board#winner?` method as our loop condition * Add `Player#insignia` so we can print the correct player insignia depending on who the current player is * Print the board and a prompt for coordinates * Switch the current player after a player finishes moving --- spec/board_spec.rb | 3 +++ spec/player_spec.rb | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'spec') diff --git a/spec/board_spec.rb b/spec/board_spec.rb index ae1bdd0..09f50e1 100644 --- a/spec/board_spec.rb +++ b/spec/board_spec.rb @@ -57,4 +57,7 @@ EOF @board.instance_variable_get(:@board)[1][2].must_equal value end end + + describe '#winner?' do + end end diff --git a/spec/player_spec.rb b/spec/player_spec.rb index d33ac05..11bfd35 100644 --- a/spec/player_spec.rb +++ b/spec/player_spec.rb @@ -13,6 +13,14 @@ describe Player do end end + describe '#insignia' do + it 'must be the correct insignia' do + insignia = Player::INSIGNIAS[:o] + player = Player.new(insignia, Board.new) + player.insignia.must_equal insignia + end + end + describe '#move' do before do @board = Board.new -- cgit v1.2.3