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

Newline before assert #157

Closed
sandstrom opened this issue Jan 23, 2022 · 0 comments · Fixed by #163
Closed

Newline before assert #157

sandstrom opened this issue Jan 23, 2022 · 0 comments · Fixed by #163

Comments

@sandstrom
Copy link

In our tests we try to keep all assertions at the last line(s), and always a newline in-between.

Don't know if this is something others prefer, but thought I'd add the issue here. If others find it useful too, maybe it's something that could be added as a cop.

test 'user tokens contains name and email' do
    @user.name = 'John Doe'
    @user.primary_email = '[email protected]'

    assert_includes(@user.tokens, 'John')
    assert_includes(@user.tokens, 'Doe')
    assert_includes(@user.tokens, '[email protected]')
  end
koic added a commit to koic/rubocop-minitest that referenced this issue Mar 10, 2022
Fixes rubocop#157.

This PR adds new `Minitest/EmptyLinesBeforeAssertionMethod` cop.

This cop enforces empty line before assertion method.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
koic added a commit to koic/rubocop-minitest that referenced this issue Mar 11, 2022
… cop

Fixes rubocop#157.

This PR adds new `Minitest/EmptyLinesBeforeAssertionMethods` cop.

This cop enforces empty line before assertion method.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
koic added a commit to koic/rubocop-minitest that referenced this issue Oct 10, 2022
Fixes rubocop#157.

This PR adds new `Minitest/EmptyLineBeforeAssertionMethod` cop.

This cop enforces empty line before assertion method.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
koic added a commit to koic/rubocop-minitest that referenced this issue Oct 12, 2022
Fixes rubocop#157.

This PR adds new `Minitest/EmptyLineBeforeAssertionMethods` cop.

This cop enforces empty line before assertion method because it separates assertion phase.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
koic added a commit to koic/rubocop-minitest that referenced this issue Oct 12, 2022
Fixes rubocop#157.

This PR adds new `Minitest/EmptyLineBeforeAssertionMethods` cop.

This cop enforces empty line before assertion method because it separates assertion phase.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
koic added a commit to koic/rubocop-minitest that referenced this issue Oct 12, 2022
Fixes rubocop#157.

This PR adds new `Minitest/EmptyLineBeforeAssertionMethods` cop.

This cop enforces empty line before assertion method because it separates assertion phase.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
koic added a commit to koic/rubocop-minitest that referenced this issue Oct 13, 2022
Fixes rubocop#157.

This PR adds new `Minitest/EmptyLineBeforeAssertionMethods` cop.

This cop enforces empty line before assertion method because it separates assertion phase.

```ruby
# bad
do_something
assert_equal(expected, actual)

# good
do_something

assert_equal(expected, actual)
```
@koic koic closed this as completed in #163 Oct 15, 2022
koic added a commit that referenced this issue Oct 15, 2022
…assertion_method_cop

[Fix #157] Add new `Minitest/EmptyLineBeforeAssertionMethods` cop
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

Successfully merging a pull request may close this issue.

1 participant