|
410 | 410 | end |
411 | 411 |
|
412 | 412 | describe OctocatalogDiff::Catalog do |
413 | | - describe '#remove_existing_resources' do |
| 413 | + describe '#resources_missing_from_catalog' do |
414 | 414 | let(:catalog) do |
415 | 415 | opts = { |
416 | 416 | compare_file_text: false, |
|
422 | 422 |
|
423 | 423 | it 'should raise error if resource is not in expected format' do |
424 | 424 | test_arg = ['Foo-Bar'] |
425 | | - expect { catalog.send(:remove_existing_resources, test_arg) }.to raise_error(ArgumentError, /Resource Foo-Bar /) |
| 425 | + expect { catalog.send(:resources_missing_from_catalog, test_arg) }.to raise_error(ArgumentError, /Resource Foo-Bar /) |
426 | 426 | end |
427 | 427 |
|
428 | 428 | it 'should return full array when no matches' do |
429 | 429 | allow(catalog).to receive(:resource).with(type: 'Foo', title: 'bar').and_return(nil) |
430 | 430 | allow(catalog).to receive(:resource).with(type: 'Baz', title: 'biff').and_return(nil) |
431 | 431 | test_arg = ['Foo[bar]', 'Baz[biff]'] |
432 | | - result = catalog.send(:remove_existing_resources, test_arg) |
| 432 | + result = catalog.send(:resources_missing_from_catalog, test_arg) |
433 | 433 | expect(result).to eq(['Foo[bar]', 'Baz[biff]']) |
434 | 434 | end |
435 | 435 |
|
436 | 436 | it 'should remove matching entries' do |
437 | 437 | allow(catalog).to receive(:resource).with(type: 'Foo', title: 'bar').and_return(nil) |
438 | 438 | allow(catalog).to receive(:resource).with(type: 'Baz', title: 'biff').and_return(true) |
439 | 439 | test_arg = ['Foo[bar]', 'Baz[biff]'] |
440 | | - result = catalog.send(:remove_existing_resources, test_arg) |
| 440 | + result = catalog.send(:resources_missing_from_catalog, test_arg) |
441 | 441 | expect(result).to eq(['Foo[bar]']) |
442 | 442 | end |
443 | 443 |
|
444 | 444 | it 'should return empty array with all matches' do |
445 | 445 | allow(catalog).to receive(:resource).with(type: 'Foo', title: 'bar').and_return(true) |
446 | 446 | allow(catalog).to receive(:resource).with(type: 'Baz', title: 'biff').and_return(true) |
447 | 447 | test_arg = ['Foo[bar]', 'Baz[biff]'] |
448 | | - result = catalog.send(:remove_existing_resources, test_arg) |
| 448 | + result = catalog.send(:resources_missing_from_catalog, test_arg) |
449 | 449 | expect(result).to eq([]) |
450 | 450 | end |
451 | 451 | end |
|
0 commit comments