Implement `-t' CLI option switch to specify target

This commit is contained in:
Thibault Jouan
2014-06-27 17:32:42 +00:00
parent e423a66d5c
commit e6ee3d5f77
6 changed files with 44 additions and 7 deletions

View File

@@ -0,0 +1,15 @@
Feature: CLI target option
Background:
Given a recipe with:
"""
target 'some_host.example'
task :some_task do
echo env.target
end
"""
Scenario: prints tasks name
When I successfully execute the recipe with option -t other_host.example
Then the output must contain exactly "other_host.example\n"

View File

@@ -11,7 +11,7 @@ When /^I successfully execute the recipe$/ do
assert_exit_status 0
end
When /^I successfully execute the recipe with option (-\w)$/ do |option|
When /^I successfully execute the recipe with option (-.+)$/ do |option|
run_simple "producer #{option} recipe.rb", false
assert_exit_status 0
end