]> source.dussan.org Git - redmine.git/commitdiff
cleanup: rubocop: fix Layout/ClosingHeredocIndentation and Layout/IndentHeredoc in...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 9 Nov 2019 05:24:57 +0000 (05:24 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 9 Nov 2019 05:24:57 +0000 (05:24 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18987 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
test/unit/lib/redmine/wiki_formatting/macros_test.rb

index 79d42a3b4e7859fbbf5e797884d35d32ac17d687..7aac33c00f2c23553aa2e4761543d845c86ae02f 100644 (file)
@@ -40,7 +40,6 @@ Layout/CaseIndentation:
 # Cop supports --auto-correct.
 Layout/ClosingHeredocIndentation:
   Exclude:
-    - 'test/unit/lib/redmine/wiki_formatting/macros_test.rb'
     - 'test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb'
     - 'test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb'
     - 'test/unit/lib/redmine/wiki_formatting_test.rb'
@@ -156,7 +155,6 @@ Layout/IndentFirstHashElement:
 # SupportedStyles: squiggly, active_support, powerpack, unindent
 Layout/IndentHeredoc:
   Exclude:
-    - 'test/unit/lib/redmine/wiki_formatting/macros_test.rb'
     - 'test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb'
     - 'test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb'
     - 'test/unit/lib/redmine/wiki_formatting_test.rb'
index ddf53f58201d802ac62fca4fef22eb6921716715..208c0157a406f8e772367b988501d2ae50cc885b 100644 (file)
@@ -243,15 +243,15 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest
   def test_macro_collapse_should_not_break_toc
     set_language_if_valid 'en'
 
-    text =  <<-RAW
-{{toc}}
+    text = <<~RAW
+      {{toc}}
 
-h1. Title
+      h1. Title
 
-{{collapse(Show example, Hide example)
-h2. Heading
-}}"
-RAW
+      {{collapse(Show example, Hide example)
+      h2. Heading
+      }}"
+    RAW
 
     expected_toc = '<ul class="toc"><li><strong>Table of contents</strong></li><li><a href="#Title">Title</a><ul><li><a href="#Heading">Heading</a></li></ul></li></ul>'
 
@@ -350,28 +350,26 @@ RAW
   end
 
   def test_macros_should_not_be_executed_in_pre_tags
-    text = <<-RAW
-{{hello_world(foo)}}
-
-<pre>
-{{hello_world(pre)}}
-!{{hello_world(pre)}}
-</pre>
-
-{{hello_world(bar)}}
-RAW
-
-    expected = <<-EXPECTED
-<p>Hello world! Object: NilClass, Arguments: foo and no block of text.</p>
-
-<pre>
-{{hello_world(pre)}}
-!{{hello_world(pre)}}
-</pre>
-
-<p>Hello world! Object: NilClass, Arguments: bar and no block of text.</p>
-EXPECTED
-
+    text = <<~RAW
+      {{hello_world(foo)}}
+
+      <pre>
+      {{hello_world(pre)}}
+      !{{hello_world(pre)}}
+      </pre>
+
+      {{hello_world(bar)}}
+    RAW
+    expected = <<~EXPECTED
+      <p>Hello world! Object: NilClass, Arguments: foo and no block of text.</p>
+
+      <pre>
+      {{hello_world(pre)}}
+      !{{hello_world(pre)}}
+      </pre>
+
+      <p>Hello world! Object: NilClass, Arguments: bar and no block of text.</p>
+    EXPECTED
     assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '')
   end
 
@@ -386,21 +384,19 @@ EXPECTED
   end
 
   def test_macros_with_text_should_not_mangle_following_macros
-    text = <<-RAW
-{{hello_world
-Line of text
-}}
-
-{{hello_world
-Another line of text
-}}
-RAW
-
-    expected = <<-EXPECTED
-<p>Hello world! Object: NilClass, Called with no argument and a 12 bytes long block of text.</p>
-<p>Hello world! Object: NilClass, Called with no argument and a 20 bytes long block of text.</p>
-EXPECTED
-
+    text = <<~RAW
+      {{hello_world
+      Line of text
+      }}
+
+      {{hello_world
+      Another line of text
+      }}
+    RAW
+    expected = <<~EXPECTED
+      <p>Hello world! Object: NilClass, Called with no argument and a 12 bytes long block of text.</p>
+      <p>Hello world! Object: NilClass, Called with no argument and a 20 bytes long block of text.</p>
+    EXPECTED
     assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '')
   end