Skip to content

Commit 78301e1

Browse files
committed
SymDB extractor spec: restore top-level rescue test
#5717 deleted the spec at extractor_spec.rb that exercised the top-level rescue in Extractor#extract_all. The production rescue is still in place at extractor.rb:149-151 — the deletion was an unintentional artifact of the squash rebase and left the rescue path uncovered. Restore the original test so the rescue is exercised again.
1 parent 0da6cc2 commit 78301e1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

spec/datadog/symbol_database/extractor_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,17 @@ def extract_all_clean
16671667
extractor.extract_all
16681668
end
16691669

1670+
context 'top-level rescue' do
1671+
it 'returns [] and logs when collection raises' do
1672+
allow(extractor).to receive(:collect_extractable_modules).and_raise(StandardError, 'boom')
1673+
expect(logger).to receive(:debug) { |&block| expect(block.call).to match(/extract_all.*StandardError.*boom/i) }
1674+
1675+
result = extractor.extract_all
1676+
1677+
expect(result).to eq([])
1678+
end
1679+
end
1680+
16701681
context 'simple class in one file' do
16711682
before do
16721683
@file = create_test_file('user.rb', <<~RUBY)

0 commit comments

Comments
 (0)