Commit ff2beebb authored by Arturo Herrero's avatar Arturo Herrero

Fix raise_error warning

WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks
false positives, since literally any other error would cause the
expectation to pass, including those raised by Ruby (e.g.
`NoMethodError`, `NameError` and `ArgumentError`), meaning the code you
are intending to test may not even get reached. Instead consider using
`expect { }.not_to raise_error` or `expect { }.to
raise_error(DifferentSpecificErrorClass)`.
parent f1f359fe
......@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Usage::MetricDefinition do
end
it 'has all definitons valid' do
expect { described_class.definitions }.not_to raise_error(Gitlab::Usage::Metric::InvalidMetricError)
expect { described_class.definitions }.not_to raise_error
end
describe '#key' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment