summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-09 14:11:02 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-11-09 14:11:02 +0000
commitbbef1d6c0f667b492422adeb4aa74a310528d97d (patch)
treecef39699938adc45844766e26c119c6f771af431 /test/unit
parentb18ba29c87c72b1b12d16208f39d5e3cdd22cba8 (diff)
downloadredmine-bbef1d6c0f667b492422adeb4aa74a310528d97d.tar.gz
redmine-bbef1d6c0f667b492422adeb4aa74a310528d97d.zip
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
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb68
1 files changed, 33 insertions, 35 deletions
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 "<pre>test\n</pre>", @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 "<p>This is a list:</p>\n\n<ul>\n<li>One</li>\n<li>Two</li>\n</ul>", @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
-<p>This is some text<sup id="fnref1"><a href="#fn1">1</a></sup>.</p>
-<div class="footnotes">
-<hr>
-<ol>
-
-<li id="fn1">
-<p>This is the foot note&nbsp;<a href="#fnref1">&#8617;</a></p>
-</li>
-
-</ol>
-</div>
-EXPECTED
+ text = <<~STR
+ This is some text[^1].
+ [^1]: This is the foot note
+ STR
+ expected = <<~EXPECTED
+ <p>This is some text<sup id="fnref1"><a href="#fn1">1</a></sup>.</p>
+ <div class="footnotes">
+ <hr>
+ <ol>
+
+ <li id="fn1">
+ <p>This is the foot note&nbsp;<a href="#fnref1">&#8617;</a></p>
+ </li>
+
+ </ol>
+ </div>
+ EXPECTED
assert_equal expected.gsub(%r{[\r\n\t]}, ''), @formatter.new(text).to_html.gsub(%r{[\r\n\t]}, '')
end