Refactor and fix features

This commit is contained in:
Thibault Jouan
2014-05-29 14:31:13 +00:00
parent 237e6db740
commit 2fecb4bde4
18 changed files with 126 additions and 178 deletions

View File

@@ -1,42 +1,31 @@
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
Background:
Given a recipe with:
"""
task :task_ok do
condition { true }
echo 'some mesasge'
end
task :task_ko do
condition { false }
end
"""
Scenario: prints tasks name
When I successfully execute the recipe with option -v
Then the output must match /Task:.+task_ok/
Scenario: prints whether condition is met
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/
Then the output must match /task_ok.+ action: echo/
Scenario: formats message with our simple logger
Given a recipe with:
"""
task :say_hello do
end
"""
When I successfully execute the recipe with option -v
Then the output must match /\ATask:.+say_hello.*\n.*condition/
Then the output must match /\ATask:.+task_ok.*\n.*condition/