diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 79d42a3b4..7aac33c00 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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' diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index ddf53f582..208c0157a 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -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 = '
' @@ -350,28 +350,26 @@ RAW end def test_macros_should_not_be_executed_in_pre_tags - text = <<-RAW -{{hello_world(foo)}} + text = <<~RAW + {{hello_world(foo)}} -
-{{hello_world(pre)}}
-!{{hello_world(pre)}}
-
+
+ {{hello_world(pre)}}
+ !{{hello_world(pre)}}
+
-{{hello_world(bar)}}
-RAW
+ {{hello_world(bar)}}
+ RAW
+ expected = <<~EXPECTED
+ Hello world! Object: NilClass, Arguments: foo and no block of text.
- expected = <<-EXPECTED -Hello world! Object: NilClass, Arguments: foo and no block of text.
- -
-{{hello_world(pre)}}
-!{{hello_world(pre)}}
-
-
-Hello world! Object: NilClass, Arguments: bar and no block of text.
-EXPECTED +
+ {{hello_world(pre)}}
+ !{{hello_world(pre)}}
+
+ Hello world! Object: NilClass, Arguments: bar and no block of text.
+ 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 -Hello world! Object: NilClass, Called with no argument and a 12 bytes long block of text.
-Hello world! Object: NilClass, Called with no argument and a 20 bytes long block of text.
-EXPECTED + text = <<~RAW + {{hello_world + Line of text + }} + {{hello_world + Another line of text + }} + RAW + expected = <<~EXPECTED +Hello world! Object: NilClass, Called with no argument and a 12 bytes long block of text.
+Hello world! Object: NilClass, Called with no argument and a 20 bytes long block of text.
+ EXPECTED assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '') end