rubocop-minitest icon indicating copy to clipboard operation
rubocop-minitest copied to clipboard

Newline before assert

Open sandstrom opened this issue 3 years ago • 0 comments

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

sandstrom avatar Jan 23 '22 16:01 sandstrom