Improve source recipe keyword feature:

* Improve error reporting from sourced recipe;
* Extract cucumber feature from recipe one.
This commit is contained in:
Thibault Jouan
2013-07-30 22:47:32 +00:00
parent b1c99dbeeb
commit 3792f60a5c
4 changed files with 45 additions and 16 deletions

33
features/source.feature Normal file
View File

@@ -0,0 +1,33 @@
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 output must match:
"""
\AOK
sourced_recipe.rb:3:.+invalid recipe keyword `invalid_keyword'
recipe.rb:1:.+
"""