summaryrefslogtreecommitdiff
path: root/features/step_definitions/mastermind.rb
blob: b7f7c8629814abd4e5da0f97771d6fd9cceb8cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# mastermind.rb

Given /^I am not yet playing$/ do
end

When /^I start a new game$/ do
	@messenger = StringIO.new
	game =Mastermind::Game.new(@messenger)
	game.start
end

Then /^the game should say "(.$)"$/ do |message|
	@messenger.string.split("\n").should include(message)
end

Given /^the secret code is (. . . .)$/ do |code|
	@messenger = StringIO.new	
	game = Mastermind::Game.new(@messenger)
	game.start(code.split)
end