Skip to content

Add a Never Check for a Bare Exception guideline #105

@pirj

Description

@pirj

Taken from Effective Testing with RSpec book.
There's a matching RSpec/UnspecifiedException cop in RuboCop-RSpec.

Example problem with it.

The negated form has the opposite problem, and the exception should not be specified, as another exception may appear instead, the example will pass, and the code that is raising the exception in question won't even be run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions