You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Using the raise_error matcher without specifying a particular error type is quite dangerous, as it swallows any sort of exception, including syntax errors and rspec expectation errors. It's hard for me to imagine a reasonable justification for the author of a test not caring at all what type of error is thrown; in my opinion it would be more helpful to users of rspec to be forced to think at least a little bit about what type of error they are expecting.
If there's no agreement on that, then at least perhaps it might be worth considering changing the default from Exception to StandardError.
Using the
raise_errormatcher without specifying a particular error type is quite dangerous, as it swallows any sort of exception, including syntax errors and rspec expectation errors. It's hard for me to imagine a reasonable justification for the author of a test not caring at all what type of error is thrown; in my opinion it would be more helpful to users of rspec to be forced to think at least a little bit about what type of error they are expecting.If there's no agreement on that, then at least perhaps it might be worth considering changing the default from
ExceptiontoStandardError.For quick reference:
https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers/built_in/raise_error.rb#L11
https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers/built_in/raise_error.rb#L42-L49