palkan / n_plus_one_control

RSpec and Minitest matchers to prevent N+1 queries problem
MIT License
553 stars 20 forks source link

Suppress warning in spec #51

Closed wonda-tea-coffee closed 2 years ago

wonda-tea-coffee commented 2 years ago

What is the purpose of this pull request?

Suppress warning in spec

What changes did you make? (overview)

Suppress the following warnings

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)`. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/runner/work/n_plus_one_control/n_plus_one_control/spec/n_plus_one_control/rspec/matchers/perform_linear_number_of_queries_spec.rb:11:in `block (4 levels) in <top (required)>'.
palkan commented 2 years ago

Thanks!