Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSpec/UnspecifiedException: break on non-send blocks to avoid false positives on functions named raise_exception #1960

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

aarestad
Copy link
Contributor

@aarestad aarestad commented Sep 21, 2024

Fixes a false positive in the UnspecifiedException cop that is triggered when a function under test is literally called raise_exception or raise_error.

Resolves #1949.

@aarestad aarestad requested a review from a team as a code owner September 21, 2024 22:02
.gitignore Outdated Show resolved Hide resolved
@bquorning bquorning requested a review from a team September 23, 2024 06:36
@bquorning
Copy link
Collaborator

Can I ask you for a review @pirj ?

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it fix #1954, too? Can you please add a spec and a changelog entry, or remove this mention from the pr description?

I’d say the cop should be disabled and deprecated, but if you’re fine with fizing it, I have no objections, too.

Thank you!

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@bquorning bquorning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final nitpick from me 😬

@aarestad aarestad force-pushed the unspecified-exception-fix branch 5 times, most recently from 8651d2a to 18e94a8 Compare September 26, 2024 14:35
@aarestad aarestad force-pushed the unspecified-exception-fix branch from 18e94a8 to a59315f Compare September 26, 2024 14:37
@bquorning bquorning merged commit 79e0bf7 into rubocop:master Sep 26, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RSpec/UnspecifiedException appears to trigger if the subject function is named raise_exception
4 participants