Created
May 24, 2011 03:05
-
-
Save searls/988081 to your computer and use it in GitHub Desktop.
Dearest friend, Mike Busch -- example taken from the RSpec Book: http://media.pragprog.com/titles/achbd/code/cb/42/spec/codebreaker/game_spec.rb
This file contains hidden or 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
#compare to RSpec Book: http://media.pragprog.com/titles/achbd/code/cb/42/spec/codebreaker/game_spec.rb | |
require 'spec_helper' | |
module Codebreaker | |
describe Codebreaker::Game do | |
let(:output) { gimme(IO) } | |
let(:game) { Game.new(output) } | |
describe '#start' do | |
before do | |
game.start('1234') | |
end | |
it 'sends a welcome message' do | |
#the `!` is necessary b/c puts is a private method on IO | |
verify!(output).puts('Welcome to Codebreaker!') | |
end | |
it 'prompts for the first guess' do | |
verify!(output).puts('Enter guess:') | |
end | |
end | |
# ... # | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment