Implement verbose mode

This commit is contained in:
Thibault Jouan
2014-05-19 22:22:42 +00:00
parent 2b86bbf112
commit 8291f1bcfd
16 changed files with 183 additions and 20 deletions

View File

@@ -5,5 +5,5 @@ Feature: CLI usage
Then the exit status must be 64
And the output must contain exactly:
"""
Usage: producer recipe_file
Usage: producer [-v] recipe_file
"""

View File

@@ -0,0 +1,33 @@
Feature: CLI verbose option
Scenario: prints tasks name
Given a recipe with:
"""
task :say_hello do
end
"""
When I successfully execute the recipe with option -v
Then the output must match /Task:.+say_hello/
Scenario: prints whether condition is met
Given a recipe with:
"""
task :task_ok do
condition { true }
end
task :task_ko do
condition { false }
end
"""
When I successfully execute the recipe with option -v
Then the output must match /task_ok.+ condition: met.*task_ko.* condition: NOT met/
Scenario: prints actions info
Given a recipe with:
"""
task :say_hello do
echo 'hello message'
end
"""
When I successfully execute the recipe with option -v
Then the output must match /say_hello.+ action: echo/

View File

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