-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cucumber feature and documentation for inheritance (Fix #20)
- Loading branch information
1 parent
45fe5d6
commit ce88aa8
Showing
3 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Feature: Inherit values from parent environment in base.yml | ||
In order to enable large numbers of environments | ||
As a developer using Yacht | ||
I want to inherit values from a parent environment in a child environment | ||
|
||
Background: | ||
Given a file named "yacht/base.yml" with: | ||
""" | ||
grandpa: | ||
:clan: McGillicuddy | ||
:age: 70 | ||
:car: | ||
:make: oldsmobile | ||
:year: 1955 | ||
pa: | ||
_parent: grandpa | ||
:age: 40 | ||
:car: | ||
:year: 1980 | ||
sonnyboy: | ||
_parent: pa | ||
:age: 10 | ||
:car: tricycle | ||
""" | ||
And I set Yacht's YAML directory to: "yacht" | ||
|
||
Scenario: Inherit from direct parent | ||
When I load Yacht with environment: "pa" | ||
Then Yacht should contain the following hash: | ||
""" | ||
{ | ||
'_parent' => 'grandpa', | ||
:clan => 'McGillicuddy', | ||
:age => 40, | ||
:car => { | ||
:make=>"oldsmobile", | ||
:year=>1980 | ||
} | ||
} | ||
""" | ||
|
||
Scenario: Inherit from direct parent and ancestors | ||
When I load Yacht with environment: "sonnyboy" | ||
Then Yacht should contain the following hash: | ||
""" | ||
{ | ||
'_parent' => 'pa', | ||
:clan => 'McGillicuddy', | ||
:age => 10, | ||
:car => 'tricycle' | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters