producer-core/features/recipe_ask.feature
Thibault Jouan 18b835b10e Improve test suite performance with aruba wrapper:
* Implement ArubaProgramWrapper in cucumber env;
* Tag a few features to not use the wrapper as aruba doesn't support yet
  interactive testing with in process mode, and reported program name
  will not be the correct one;
* Assign required standard streams to CLI and Env classes.
2014-05-30 23:14:00 +00:00

24 lines
491 B
Gherkin

Feature: `ask' recipe 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