Implement `ask' recipe keyword

This commit is contained in:
Thibault Jouan
2013-12-22 23:54:19 +00:00
parent 70109615c8
commit 7e062e06a1
7 changed files with 114 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
Feature: `ask' recipe keyword
Scenario: prompts user with a list of choices on standard output
Given a recipe with:
"""
task :ask_letter do
letter = ask 'Which letter?', %w[A B]
echo letter
end
"""
When I execute the recipe interactively
And I type "1"
Then the output must contain:
"""
Which letter?
0: A
1: B
Choice:
B
"""
And the exit status must be 0

View File

@@ -10,3 +10,7 @@ When(/^I successfully execute the recipe$/) do
step 'I execute the recipe'
assert_exit_status(0)
end
When(/^I execute the recipe interactively$/) do
run_interactive('producer recipe.rb')
end