Add and apply Style/LineEndConcatenation rule

We were already using it in most places.

Note that enabling this rule means we've got to change a few lines in
order to follow the LineEndStringConcatenationIndentation rule. In the
link list tests, the easiest way to do so was to use heredoc instead,
which IMHO improves readability over the previous version.
This commit is contained in:
Javi Martín
2023-07-18 03:36:22 +02:00
parent 96a0aa2a88
commit cbda85c48d
3 changed files with 21 additions and 12 deletions

View File

@@ -18,9 +18,12 @@ describe Shared::LinkListComponent do
["Home", "/"], ["Info", "/info"], class: "menu"
)
expect(page).to be_rendered with: '<ul class="menu">' + "\n" +
'<li><a href="/">Home</a></li>' + "\n" +
'<li><a href="/info">Info</a></li>' + "\n</ul>\n"
expect(page).to be_rendered with: <<~HTML
<ul class="menu">
<li><a href="/">Home</a></li>
<li><a href="/info">Info</a></li>
</ul>
HTML
end
it "accepts anchor tags" do
@@ -28,9 +31,12 @@ describe Shared::LinkListComponent do
'<a href="/">Home</a>'.html_safe, ["Info", "/info"], class: "menu"
)
expect(page).to be_rendered with: '<ul class="menu">' + "\n" +
'<li><a href="/">Home</a></li>' + "\n" +
'<li><a href="/info">Info</a></li>' + "\n</ul>\n"
expect(page).to be_rendered with: <<~HTML
<ul class="menu">
<li><a href="/">Home</a></li>
<li><a href="/info">Info</a></li>
</ul>
HTML
end
it "accepts options for links" do