Implement `ask' recipe keyword
This commit is contained in:
22
features/recipes/ask.feature
Normal file
22
features/recipes/ask.feature
Normal 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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user