Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created December 3, 2013 03:15
Show Gist options
  • Save tarynsauer/7763338 to your computer and use it in GitHub Desktop.
Save tarynsauer/7763338 to your computer and use it in GitHub Desktop.
describe 'UI' do
context 'player move messages' do
before :each do
board = double('board')
@ui = UI.new(board)
@player = double('player', :marker => 'X' )
end
describe '#first_move_message' do
it "prints a message with the player's marker" do
printed = capture_stdout { @ui.first_move_message(@player) }
printed.should include("Player 'X'")
end
end
describe '#next_move_message' do
it "prints a message with the player's marker" do
printed = capture_stdout { @ui.next_move_message(@player) }
printed.should include("Player 'X'")
end
end
describe '#winning_game_message' do
it "prints a message with the player's marker" do
printed = capture_stdout { @ui.winning_game_message(@player) }
printed.should include("Player 'X'")
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment