Skip to content

New cop to discourage context with only a single test #2001

Closed
@fatkodima

Description

@fatkodima

Relevant to #2000.

When the context block has only a single test, it makes little sense to actually use the context block and making the code unnecessary indented and a little more complicated.

# bad
context 'when condition' do
  it 'tests something' do
  end
end

# good
it 'tests something when condition' do
end

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