Skip to content

FileName cop to check rspec file ends in _rspec #412

@IanVaughan

Description

@IanVaughan

We just hit this, and thought maybe it should be added to the core...

Similar to file_name.rb in Rubocop core, the idea here would be to check files under the /spec directory to ensure they end in _rspec.

Users would need to exclude common non-spec directories like fixtures etc, and maybe this could provide a suggested default for common ones?

I'm happy to do this myself, but just wanted to check if a) I had missed this if already present, or b) was going in the wrong direction and should think of something else!

# @example
    #   # bad
    #   whatever.rb 
    #
    #   # bad
    #   whatever_foo.rb 
    #
    #   # good
    #   whatever_spec.rb 

See also file_path.rb

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