-
Notifications
You must be signed in to change notification settings - Fork 36
/
precedence.feature
91 lines (83 loc) · 2.53 KB
/
precedence.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Feature: Test new value precedence and merging behaviour
Background:
Given a directory named "templates"
And a file named "templates/test.erb" with:
"""
test_var: <%= test_var %>
"""
Scenario: Global vars from two plugins
Given a file named "common.yaml" with:
"""
---
exec: [ 'cat','test.txt' ]
data_sources: [ "defaults" , "file" ]
template_sources: [ "file" ]
defaults:
test_var: "From defaults plugin"
environments:
development:
global_values:
test_var: 'From file plugin'
test.erb:
target: test.txt
"""
When I successfully run `tiller -b . -v`
Then a file named "test.txt" should exist
And the file "test.txt" should contain:
"""
test_var: From file plugin
"""
Scenario: Template vars from two plugins
Given a file named "common.yaml" with:
"""
---
exec: [ 'cat','test.txt' ]
data_sources: [ "defaults" , "file" ]
template_sources: [ "file" ]
defaults:
test.erb:
test_var: "From defaults plugin"
environments:
development:
test.erb:
target: test.txt
config:
test_var: "From file plugin"
"""
When I successfully run `tiller -b . -v`
Then a file named "test.txt" should exist
And the file "test.txt" should contain:
"""
test_var: From file plugin
"""
Scenario: Environment global should over-ride template vars from earlier plugins
Given a file named "common.yaml" with:
"""
---
exec: [ 'cat','test.txt' ]
data_sources: [ "defaults" , "file" , "environment" ]
template_sources: [ "file" ]
environment:
prefix: 'test_'
defaults:
test.erb:
test_var: "From defaults plugin"
environments:
development:
test.erb:
target: test.txt
config:
test_var: "From file plugin"
"""
And I set the environment variables exactly to:
| variable | value |
| var | from environment |
When I successfully run `tiller -b . -v`
Then a file named "test.txt" should exist
And the file "test.txt" should contain:
"""
test_var: from environment
"""
And the output should contain "Merging duplicate data values"
And the output should contain "test_var => 'From defaults plugin' being replaced by : 'From file plugin' from FileDataSource"
And the output should contain "test_var => 'From file plugin' being replaced by : 'from environment' from EnvironmentDataSource"