producer-core/features/task_ask.feature
2014-09-22 19:43:36 +00:00

24 lines
489 B
Gherkin

Feature: `ask' task keyword
@exec
Scenario: prompts user with a list of choices on standard output
Given a recipe with:
"""
task :ask_letter do
letter = ask 'Which letter?', [[:a, ?A], [:b, ?B]]
echo letter.inspect
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