Implement recipe arguments

CLI will stop arguments processing after the special `--' argument,
the rest will be saved in the env and accessible through a new task
keyword: `recipe_argv'.
This commit is contained in:
Thibault Jouan
2015-04-04 04:41:25 +00:00
parent f17f8c354f
commit 433f830c54
7 changed files with 54 additions and 1 deletions

View File

@@ -51,6 +51,11 @@ When /^I successfully execute the recipe with option (-.+)$/ do |option|
assert_exit_status 0
end
When /^I successfully execute the recipe with arguments "([^"]+)"$/ do |arguments|
run_simple "producer recipe.rb -- #{arguments}", false
assert_exit_status 0
end
When /^I execute the recipe interactively$/ do
run_interactive 'producer recipe.rb'
end

View File

@@ -0,0 +1,13 @@
Feature: `recipe_argv' task keyword
Background:
Given a recipe with:
"""
task :echo_arguments do
echo recipe_argv
end
"""
Scenario: returns recipe arguments
When I successfully execute the recipe with arguments "foo bar"
Then the output must contain exactly "foo\nbar\n"