Merge Task::DSL into Task

This commit is contained in:
Thibault Jouan
2014-09-22 16:29:35 +00:00
parent 166dae681c
commit 2c335b2437
9 changed files with 154 additions and 244 deletions

23
features/task_ask.feature Normal file
View File

@@ -0,0 +1,23 @@
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