Skip to content

Cop idea: detect repeated describe/context description #856

@lazycoder9

Description

@lazycoder9

In the company, we had a situation when someone pushed specs with duplicated context occasionally and only PR reviewers caught it.

context "when cool thing happens" do
    # some examples
end

context "when cool thing happens" do
    # some examples
end

We tried to find some cops in rubocop-rspec which will detect this kind of occasion, but there were only RSpec/RepeatedExample and RSpec/RepeatedDescription and these cops do not detect repeated descriptions in describe/context, only examples.
So my question is, does it worth to implement different cops for describe/context like above ones or we can extend them to cover these cases?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions