Last active
August 29, 2015 14:04
-
-
Save workmad3/3215110d7d074e133cb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe TTT::ConsolePrinter | |
subject{TTT::ConsolePrinter.new(output)} | |
let(:output) {StringIO.new("")} | |
let(:board) {...} | |
it "should be awesome" do | |
subject.print(board) | |
expect(output.read).to eq("An awesome TTT board") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TTT | |
class ConsolePrinter | |
def initialize(output) | |
@output = output | |
end | |
def print(board) | |
@output.puts "An awesome TTT board" | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output = TTT::ConsolePrinter.new($STDOUT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment