Improve features directory tree
This commit is contained in:
10
features/recipes/env.feature
Normal file
10
features/recipes/env.feature
Normal file
@@ -0,0 +1,10 @@
|
||||
Feature: env recipe keyword
|
||||
|
||||
Scenario: exposes the internal env object
|
||||
Given a recipe with:
|
||||
"""
|
||||
puts env.current_recipe.filepath
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
And the output must contain exactly "recipe.rb\n"
|
25
features/recipes/evaluation.feature
Normal file
25
features/recipes/evaluation.feature
Normal file
@@ -0,0 +1,25 @@
|
||||
Feature: recipe evaluation
|
||||
|
||||
Scenario: evaluates ruby code in a recipe
|
||||
Given a recipe with:
|
||||
"""
|
||||
puts 'hello from recipe'
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
And the output must contain "hello from recipe"
|
||||
|
||||
Scenario: reports errors when evaluating an invalid recipe
|
||||
Given a recipe with:
|
||||
"""
|
||||
puts 'OK'
|
||||
|
||||
invalid_keyword
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 70
|
||||
And the output must match:
|
||||
"""
|
||||
\AOK
|
||||
recipe.rb:3:.+invalid recipe keyword `invalid_keyword'
|
||||
"""
|
34
features/recipes/source.feature
Normal file
34
features/recipes/source.feature
Normal file
@@ -0,0 +1,34 @@
|
||||
Feature: source recipe keyword
|
||||
|
||||
Scenario: requires a recipe file
|
||||
Given a recipe with:
|
||||
"""
|
||||
source 'sourced_recipe'
|
||||
"""
|
||||
And a file named "sourced_recipe.rb" with:
|
||||
"""
|
||||
puts 'sourced recipe'
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
And the output must contain "sourced recipe"
|
||||
|
||||
Scenario: reports errors from sourced recipes
|
||||
Given a recipe with:
|
||||
"""
|
||||
source 'sourced_recipe'
|
||||
"""
|
||||
And a file named "sourced_recipe.rb" with:
|
||||
"""
|
||||
puts 'OK'
|
||||
|
||||
invalid_keyword
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 70
|
||||
Then the output must match:
|
||||
"""
|
||||
\AOK
|
||||
sourced_recipe.rb:3:.+invalid recipe keyword `invalid_keyword'
|
||||
recipe.rb:1:.+
|
||||
"""
|
12
features/recipes/target.feature
Normal file
12
features/recipes/target.feature
Normal file
@@ -0,0 +1,12 @@
|
||||
Feature: target recipe keyword
|
||||
|
||||
Scenario: registers the target host on which tasks should be evaluated
|
||||
Given a recipe with:
|
||||
"""
|
||||
target 'some_host.example'
|
||||
|
||||
puts env.target
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
And the output must contain exactly "some_host.example\n"
|
Reference in New Issue
Block a user