|
80 | 80 | end |
81 | 81 |
|
82 | 82 | it 'should log proper messages' do |
83 | | - expect(@result.log_messages).to include('DEBUG - ENC override: role = "two"') |
| 83 | + expect(@result.log_messages).to include('DEBUG - ENC override: parameters::role = "two"') |
84 | 84 | end |
85 | 85 | end |
86 | 86 |
|
|
125 | 125 | end |
126 | 126 |
|
127 | 127 | it 'should log proper messages' do |
128 | | - expect(@result.log_messages).to include('DEBUG - ENC override: role = "two"') |
| 128 | + expect(@result.log_messages).to include('DEBUG - ENC override: parameters::role = "two"') |
129 | 129 | end |
130 | 130 | end |
131 | 131 |
|
|
170 | 170 | end |
171 | 171 |
|
172 | 172 | it 'should log proper messages' do |
173 | | - expect(@result.log_messages).to include('DEBUG - ENC override: role = "two"') |
| 173 | + expect(@result.log_messages).to include('DEBUG - ENC override: parameters::role = "two"') |
174 | 174 | end |
175 | 175 | end |
176 | 176 |
|
|
195 | 195 | expect(@result.exitcode).to eq(0), "Runtime error: #{@result.logs}" |
196 | 196 | end |
197 | 197 |
|
198 | | - it 'should show no changes' do |
199 | | - expect(@result.to).to eq([]) |
| 198 | + it 'should return a proper catalog' do |
| 199 | + expect(@result.to).to be_a_kind_of(OctocatalogDiff::API::V1::Catalog) |
| 200 | + end |
| 201 | + |
| 202 | + it 'should contain resource affected by overridden parameters' do |
| 203 | + resource = @result.to.resource(type: 'File', title: '/tmp/one') |
| 204 | + expect(resource).to be_a_kind_of(Hash) |
| 205 | + expect(resource['parameters']['content']).to eq('two') |
200 | 206 | end |
201 | 207 |
|
202 | 208 | it 'should log proper messages' do |
203 | | - expect(@result.log_messages).to include('DEBUG - ENC override: role = "two"') |
| 209 | + expect(@result.log_messages).to include('DEBUG - ENC override: parameters::role = "two"') |
204 | 210 | end |
205 | 211 | end |
206 | 212 |
|
|
231 | 237 | parse_result = JSON.parse(@result.stdout)['diff'].map { |x| OctocatalogDiff::Spec.remove_file_and_line(x) } |
232 | 238 | expect(parse_result.size).to eq(2) |
233 | 239 | expect(parse_result).to include( |
234 | | - diff_type: '~', |
235 | | - type: 'File', |
236 | | - title: '/tmp/one', |
237 | | - structure: %w(parameters content), |
238 | | - old_value: 'two', |
239 | | - new_value: 'one' |
| 240 | + 'diff_type' => '~', |
| 241 | + 'type' => 'File', |
| 242 | + 'title' => '/tmp/one', |
| 243 | + 'structure' => %w(parameters content), |
| 244 | + 'old_value' => 'one', |
| 245 | + 'new_value' => 'two' |
240 | 246 | ) |
241 | 247 | expect(parse_result).to include( |
242 | | - diff_type: '~', |
243 | | - type: 'File', |
244 | | - title: '/tmp/two', |
245 | | - structure: %w(parameters content), |
246 | | - old_value: 'two', |
247 | | - new_value: 'one' |
| 248 | + 'diff_type' => '~', |
| 249 | + 'type' => 'File', |
| 250 | + 'title' => '/tmp/two', |
| 251 | + 'structure' => %w(parameters content), |
| 252 | + 'old_value' => 'one', |
| 253 | + 'new_value' => 'two' |
248 | 254 | ) |
249 | 255 | end |
250 | 256 |
|
251 | 257 | it 'should log the correct messages' do |
252 | | - expect(@result.stderr).to match(/Catalog for . will be built with OctocatalogDiff::Catalog::Computed/) |
253 | | - expect(@result.stderr).to match(/Override ipaddress from "10.20.30.40" to "10.30.50.70"/) |
254 | | - expect(@result.stderr).to match(/Override foofoo from nil to "barbar"/) |
255 | | - expect(@result.stderr).to match(/Diffs computed for rspec-node.github.net/) |
| 258 | + expect(@result.stderr).to match(/ENC override: parameters::role = "two"/) |
256 | 259 | end |
257 | 260 | end |
0 commit comments