Skip to content

Commit 1e20be2

Browse files
committed
Improve error handling assertions in HttpLinkChecker spec
1 parent 148885f commit 1e20be2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/services/better_together/metrics/http_link_checker_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ module BetterTogether
1414
expect([result.success, result.status_code, result.error]).to eq([true, '200', nil])
1515
end
1616

17-
it 'retries and returns failure for unreachable host' do
17+
it 'retries and returns failure for unreachable host' do # rubocop:todo RSpec/MultipleExpectations
1818
stub_request(:head, 'https://nope.test/').to_timeout
1919

2020
result = described_class.new('https://nope.test/', retries: 1).call
2121

22-
# failed, no status_code, error present
23-
expect([result.success, result.status_code, result.error.class]).to eq([false, nil, StandardError])
22+
# failed, no status_code, error present (error should be a StandardError ancestor)
23+
expect(result.success).to be(false)
24+
expect(result.status_code).to be_nil
25+
expect(result.error).to be_a(StandardError)
2426
end
2527
end
2628
end

0 commit comments

Comments
 (0)