Unflatten features directory tree

This commit is contained in:
Thibault Jouan
2014-11-18 11:58:23 +00:00
parent 86a84bbe12
commit 2d3975d47f
36 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
Feature: `macro' recipe keyword
Scenario: declares a new recipe keyword accepting task code
Given a recipe with:
"""
macro :hello do
echo 'hello macro'
end
hello
"""
When I successfully execute the recipe
Then the output must contain "hello macro"
Scenario: declares a new task keyword
Given a recipe with:
"""
macro(:hello) { echo 'hello macro' }
task(:some_task) { hello }
"""
When I successfully execute the recipe
Then the output must contain "hello macro"
Scenario: supports arguments
Given a recipe with:
"""
macro :my_echo do |kind, message|
echo "#{kind}: #{message}"
end
my_echo 'my', 'hello'
"""
When I successfully execute the recipe
Then the output must contain "my: hello"
Scenario: supports arguments in conditions
Given a recipe with:
"""
macro :my_echo do |message|
condition { message =~ /foo/ }
echo message
end
%w[foo bar].each { |e| my_echo e }
"""
When I successfully execute the recipe
Then the output must contain "foo"
And the output must not contain "bar"