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

Minitest/EmptyLineBeforeAssertionMethods false positive when assertion has return value #271

Closed
Earlopain opened this issue Oct 26, 2023 · 1 comment · Fixed by #273
Closed

Comments

@Earlopain
Copy link
Contributor

Earlopain commented Oct 26, 2023

Expected behavior

No offence for the following code

def test_something
  e = assert_raises(StandardError) { do_something }
  assert_match("Error", e.message)
end

Actual behavior

Minitest/EmptyLineBeforeAssertionMethods: Add empty line before assertion.

def test_something
  e = assert_raises(StandardError) { do_something }

  assert_match("Error", e.message)
end

RuboCop version

$ [bundle exec] rubocop -V
1.56.4 (using Parser 3.2.2.4, rubocop-ast 1.29.0, running on ruby 3.2.2) [x86_64-linux-musl]
  - rubocop-erb 0.3.0
  - rubocop-factory_bot 2.24.0
  - rubocop-minitest 0.32.2
  - rubocop-performance 1.19.1
  - rubocop-rails 2.21.2
@fatkodima
Copy link
Contributor

Yeah, that was annoying - #273.

@koic koic closed this as completed in #273 Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants