|
37 | 37 | end
|
38 | 38 |
|
39 | 39 | context 'fact variable using top scope' do
|
40 |
| - let(:code) { '$::operatingsystem' } |
| 40 | + let(:code) { '$::fqdn' } |
41 | 41 |
|
42 |
| - it 'onlies detect a single problem' do |
43 |
| - expect(problems).to have(1).problem |
44 |
| - end |
45 |
| - |
46 |
| - it 'creates a warning' do |
47 |
| - expect(problems).to contain_warning(msg).on_line(1).in_column(1) |
48 |
| - end |
49 |
| - end |
50 |
| - |
51 |
| - context 'fact variable using top scope with curly braces in double quote' do |
52 |
| - let(:code) { '"${::operatingsystem}"' } |
53 |
| - |
54 |
| - it 'onlies detect a single problem' do |
55 |
| - expect(problems).to have(1).problem |
56 |
| - end |
57 |
| - |
58 |
| - it 'creates a warning' do |
59 |
| - expect(problems).to contain_warning(msg).on_line(1).in_column(4) |
| 42 | + it 'does not detect a single problem' do |
| 43 | + expect(problems).to have(0).problem |
60 | 44 | end
|
61 | 45 | end
|
62 | 46 |
|
|
126 | 110 | end
|
127 | 111 | end
|
128 | 112 |
|
129 |
| - context 'fact variable using top scope' do |
130 |
| - let(:code) { '$::operatingsystem' } |
131 |
| - |
132 |
| - it 'onlies detect a single problem' do |
133 |
| - expect(problems).to have(1).problem |
134 |
| - end |
135 |
| - |
136 |
| - it 'fixes the problem' do |
137 |
| - expect(problems).to contain_fixed(msg).on_line(1).in_column(1) |
138 |
| - end |
139 |
| - |
140 |
| - it 'shoulds use the facts hash' do |
141 |
| - expect(manifest).to eq("$facts['operatingsystem']") |
142 |
| - end |
143 |
| - end |
144 |
| - |
145 |
| - context 'fact variable using top scope with curly braces in double quote' do |
146 |
| - let(:code) { '"${::operatingsystem}"' } |
147 |
| - |
148 |
| - it 'fixes the problem' do |
149 |
| - expect(problems).to contain_fixed(msg).on_line(1).in_column(4) |
150 |
| - end |
151 |
| - |
152 |
| - it 'shoulds use the facts hash' do |
153 |
| - expect(manifest).to eq('"${facts[\'operatingsystem\']}"') |
154 |
| - end |
155 |
| - end |
156 |
| - |
157 | 113 | context 'with custom top scope fact variables' do
|
158 | 114 | before(:each) do
|
159 | 115 | PuppetLint.configuration.top_scope_variables = ['location', 'role']
|
|
0 commit comments