Skip to content

Commit b60d6f4

Browse files
author
Kevin Paulisse
committed
Stub tests for format_missing_references
1 parent 9983657 commit b60d6f4

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

spec/octocatalog-diff/tests/catalog_spec.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,42 @@
483483
end
484484
end
485485

486+
describe '#format_missing_references' do
487+
before(:each) do
488+
opts = { json: File.read(OctocatalogDiff::Spec.fixture_path('catalogs/reference-validation-broken.json')) }
489+
@test_obj = OctocatalogDiff::Catalog.new(opts)
490+
end
491+
492+
context 'with invalid input' do
493+
it 'should raise ArgumentError if non-array is provided' do
494+
expect do
495+
@test_obj.send(:format_missing_references, 'Hi there')
496+
end.to raise_error(ArgumentError, /format_missing_references\(\) requires a non-empty array as input/)
497+
end
498+
499+
it 'should raise ArgumentError if empty array is provided' do
500+
expect do
501+
@test_obj.send(:format_missing_references, [])
502+
end.to raise_error(ArgumentError, /format_missing_references\(\) requires a non-empty array as input/)
503+
end
504+
end
505+
506+
context 'with compilation directory specified and matching' do
507+
it 'should strip compilation directory' do
508+
end
509+
end
510+
511+
context 'with compilation directory specified and not matching' do
512+
it 'should not strip compilation directory' do
513+
end
514+
end
515+
516+
context 'with compilation directory not specified' do
517+
it 'should not strip compilation directory' do
518+
end
519+
end
520+
end
521+
486522
describe '#build_resource_hash' do
487523
before(:each) do
488524
resource_array = [

0 commit comments

Comments
 (0)