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 disallow before and a single test case #2000

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

New cop to disallow before and a single test case #2000

fatkodima opened this issue Nov 27, 2024 · 0 comments

Comments

@fatkodima
Copy link

It makes little sense to write the test code like

context 'when something' do
  before do
    # some setup
  end

  it 'tests something' do # <--- only one test case
    # some testing
  end
end

The test is now unnecessary segregated. When more before blocks precedes it outside of the context it is even harder to combine all these pieces.

Better is to write it like

context 'when something' do
  it 'tests something' do
    # some setup
    # some testing
  end
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