Skip to content

Restore EnforcedStyle: string option to VerifiedDoubleReference #2087

Open
@tylerhunt

Description

@tylerhunt

Is your feature request related to a problem? Please describe.

#1968 removed the EnforcedStyle: string option from the VerifiedDoubleReference cop on the basis that doubles aren't actually verified when the object isn't loaded, but this is the very behavior that I have depended on for some time in my own spec suites.

Describe the solution you'd like

Restore the EnforcedStyle: string option on the VerifiedDoubleReference cop.

Additional context

I like to write specs for certain parts of the codebase to be runnable without loading the full app (typically Rails), but this means in some cases that certain constants won't be loaded when running certain specs. I understand that instance doubles won't be verified when run this way, but they are verified when run in the context of the full spec suite, since the app (i.e. Rails) is loaded in that case. While there may be less value in writing the doubles this way, it also allows a decent amount of flexibility, and RuboCop should have the ability to support this use case which is supported by RSpec.

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