From: Toshi MARUYAMA Date: Sat, 9 Nov 2019 14:11:02 +0000 (+0000) Subject: cleanup: rubocop: fix Layout/ClosingHeredocIndentation and Layout/IndentHeredoc in... X-Git-Tag: 4.1.0~83 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bbef1d6c0f667b492422adeb4aa74a310528d97d;p=redmine.git cleanup: rubocop: fix Layout/ClosingHeredocIndentation and Layout/IndentHeredoc in test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb git-svn-id: http://svn.redmine.org/redmine/trunk@19020 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 11c6ad0d1..8ff28c136 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -36,7 +36,6 @@ Layout/CaseIndentation: # Cop supports --auto-correct. Layout/ClosingHeredocIndentation: Exclude: - - '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' @@ -151,7 +150,6 @@ Layout/IndentFirstHashElement: # SupportedStyles: squiggly, active_support, powerpack, unindent Layout/IndentHeredoc: Exclude: - - '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/markdown_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb index be667c890..f52f1a169 100644 --- a/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb @@ -61,23 +61,23 @@ class Redmine::WikiFormatting::MarkdownFormatterTest < ActionView::TestCase end def test_should_support_syntax_highlight - text = <<-STR -~~~ruby -def foo -end -~~~ -STR + text = <<~STR + ~~~ruby + def foo + end + ~~~ + STR assert_select_in @formatter.new(text).to_html, 'pre code.ruby.syntaxhl' do assert_select 'span.k', :text => 'def' end end def test_should_not_allow_invalid_language_for_code_blocks - text = <<-STR -~~~foo -test -~~~ -STR + text = <<~STR + ~~~foo + test + ~~~ + STR assert_equal "
test\n
", @formatter.new(text).to_html end @@ -92,35 +92,33 @@ STR end def test_markdown_should_not_require_surrounded_empty_line - text = <<-STR -This is a list: -* One -* Two -STR + text = <<~STR + This is a list: + * One + * Two + STR assert_equal "

This is a list:

\n\n", @formatter.new(text).to_html.strip end def test_footnotes - text = <<-STR -This is some text[^1]. - -[^1]: This is the foot note -STR - - expected = <<-EXPECTED -

This is some text1.

-
-
-
    - -
  1. -

    This is the foot note 

    -
  2. - -
-
-EXPECTED + text = <<~STR + This is some text[^1]. + [^1]: This is the foot note + STR + expected = <<~EXPECTED +

This is some text1.

+
+
+
    + +
  1. +

    This is the foot note 

    +
  2. + +
+
+ EXPECTED assert_equal expected.gsub(%r{[\r\n\t]}, ''), @formatter.new(text).to_html.gsub(%r{[\r\n\t]}, '') end