|
122 | 122 | end |
123 | 123 | end |
124 | 124 |
|
125 | | - context "Deep Merging" do |
126 | | - let(:config) do |
127 | | - files = ["#{fixture_path}/deep_merge/config1.yml", "#{fixture_path}/deep_merge/config2.yml"] |
128 | | - Config.load_files(files) |
129 | | - end |
130 | | - |
131 | | - it "should merge hashes from multiple configs" do |
132 | | - expect(config.inner.marshal_dump.keys.size).to eq(3) |
133 | | - expect(config.inner2.inner2_inner.marshal_dump.keys.size).to eq(3) |
134 | | - end |
135 | | - |
136 | | - it "should merge arrays from multiple configs" do |
137 | | - expect(config.arraylist1.size).to eq(6) |
138 | | - expect(config.arraylist2.inner.size).to eq(6) |
139 | | - end |
140 | | - end |
141 | 125 |
|
142 | 126 | context "Boolean Overrides" do |
143 | 127 | let(:config) do |
|
301 | 285 | context 'merging' do |
302 | 286 | let(:config) do |
303 | 287 | Config.knockout_prefix = '--' |
| 288 | + Config.overwrite_arrays = false |
304 | 289 | Config.load_files(["#{fixture_path}/knockout_prefix/config1.yml", |
305 | 290 | "#{fixture_path}/knockout_prefix/config2.yml", |
306 | 291 | "#{fixture_path}/knockout_prefix/config3.yml"]) |
|
325 | 310 | context 'in configuration phase' do |
326 | 311 | it 'should be able to assign a different overwrite_arrays value' do |
327 | 312 | Config.reset |
328 | | - Config.overwrite_arrays = true |
| 313 | + Config.overwrite_arrays = false |
329 | 314 |
|
330 | | - expect(Config.overwrite_arrays).to eq(true) |
| 315 | + expect(Config.overwrite_arrays).to eq(false) |
331 | 316 | end |
332 | 317 |
|
333 | 318 | it 'should have the default overwrite_arrays value equal false' do |
334 | 319 | Config.reset |
335 | 320 |
|
336 | | - expect(Config.overwrite_arrays).to eq(false) |
| 321 | + expect(Config.overwrite_arrays).to eq(true) |
337 | 322 | end |
338 | 323 | end |
339 | 324 |
|
|
351 | 336 | expect(config.array3).to eq([]) |
352 | 337 | end |
353 | 338 | end |
| 339 | + |
| 340 | + |
| 341 | + context 'merging' do |
| 342 | + let(:config) do |
| 343 | + Config.overwrite_arrays = false |
| 344 | + Config.load_files(["#{fixture_path}/deep_merge/config1.yml", |
| 345 | + "#{fixture_path}/deep_merge/config2.yml"]) |
| 346 | + end |
| 347 | + |
| 348 | + it 'should merge hashes from multiple configs' do |
| 349 | + expect(config.inner.marshal_dump.keys.size).to eq(3) |
| 350 | + expect(config.inner2.inner2_inner.marshal_dump.keys.size).to eq(3) |
| 351 | + end |
| 352 | + |
| 353 | + it 'should merge arrays from multiple configs' do |
| 354 | + expect(config.arraylist1.size).to eq(6) |
| 355 | + expect(config.arraylist2.inner.size).to eq(6) |
| 356 | + end |
| 357 | + end |
| 358 | + |
354 | 359 | end |
355 | 360 | end |
356 | 361 | end |
0 commit comments