summaryrefslogtreecommitdiff
path: root/features/step_definitions/mastermind.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2009-05-27 09:04:07 -0600
committermo khan <mo@mokhan.ca>2009-05-27 09:04:07 -0600
commit4b8f713fc36eadf7f974d80c72ed22be413efcbe (patch)
tree8c94415ede4525b6a4980905caf2efe8fd52c0f7 /features/step_definitions/mastermind.rb
parentda73fdb2d793f4190bd89fd210b2b6188c62e2d3 (diff)
testing git commit from gvim
Diffstat (limited to 'features/step_definitions/mastermind.rb')
-rw-r--r--features/step_definitions/mastermind.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/features/step_definitions/mastermind.rb b/features/step_definitions/mastermind.rb
index b7f7c86..f07c541 100644
--- a/features/step_definitions/mastermind.rb
+++ b/features/step_definitions/mastermind.rb
@@ -2,19 +2,23 @@
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)
+ @game = Mastermind::Game.new(@messenger)
+ @game.start(code.split)
+end
+When /^I guess (. . . .)$/ do |code|
+ @game.guess(code.split)
+end
+Then /^the mark should be (.*)$/ do |mark|
+ @messenger.string.split("\n").should include(mark)
end