Skip to content

Instantly share code, notes, and snippets.

@workmad3
Last active August 29, 2015 14:04
Show Gist options
  • Save workmad3/3215110d7d074e133cb0 to your computer and use it in GitHub Desktop.
Save workmad3/3215110d7d074e133cb0 to your computer and use it in GitHub Desktop.
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
module TTT
class ConsolePrinter
def initialize(output)
@output = output
end
def print(board)
@output.puts "An awesome TTT board"
end
end
end
output = TTT::ConsolePrinter.new($STDOUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment