-
-
Notifications
You must be signed in to change notification settings - Fork 394
Emit a special warning when nil
is passed to raise_error
#1143
Emit a special warning when nil
is passed to raise_error
#1143
Conversation
Also slightly fix alignment
"This message can be suppressed by setting: " \ | ||
"`RSpec::Expectations.configuration.on_potential_false" \ | ||
"_positives = :nothing`") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Risks or will cause? 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Risks higher than usual XD
656dc0b
to
160467a
Compare
Usage of `nil` with `raise_error` is with a high chance unintentional, including negation. fixes #1142
c0bc5e4
to
5f10c64
Compare
Do you want to a change log for this @pirj? Or shall I? |
Added in 704f0a26. |
* Add usage examples * Add specific warning for nil passed to raise_error Usage of `nil` with `raise_error` is with a high chance unintentional, including negation. fixes #1142
I've received a notification about a note, but the author removed the note. Presumably from @mathieujobin or @mjobin-mdsol.
Adding such an option makes total sense to me. Would you like to send a PR to If you want to go a step further and raise an exception (I'd go with
@JonRowe Do you support the idea? |
Thanks for the ping @pirj I can't commit to open a PR with a new config options, I'm sorry. But I created a branch on my end for testing existing projects |
@pirj I'm happy for this idea to be a thing if someone wants to make it so. |
Usage of
nil
withraise_error
is with a high chance unintentional, including negation.Fixes #1142