Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fatkodima opened this issue Nov 27, 2024 · 0 comments
Open

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

fatkodima opened this issue Nov 27, 2024 · 0 comments

Comments

@fatkodima
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant