mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
cleanup: rubocop: fix Layout/ClosingHeredocIndentation and Layout/IndentHeredoc in test/unit/lib/redmine/wiki_formatting/macros_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18987 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
fae40298d8
commit
09af8e6683
@ -40,7 +40,6 @@ Layout/CaseIndentation:
|
|||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
Layout/ClosingHeredocIndentation:
|
Layout/ClosingHeredocIndentation:
|
||||||
Exclude:
|
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/markdown_formatter_test.rb'
|
||||||
- 'test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb'
|
- 'test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb'
|
||||||
- 'test/unit/lib/redmine/wiki_formatting_test.rb'
|
- 'test/unit/lib/redmine/wiki_formatting_test.rb'
|
||||||
@ -156,7 +155,6 @@ Layout/IndentFirstHashElement:
|
|||||||
# SupportedStyles: squiggly, active_support, powerpack, unindent
|
# SupportedStyles: squiggly, active_support, powerpack, unindent
|
||||||
Layout/IndentHeredoc:
|
Layout/IndentHeredoc:
|
||||||
Exclude:
|
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/markdown_formatter_test.rb'
|
||||||
- 'test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb'
|
- 'test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb'
|
||||||
- 'test/unit/lib/redmine/wiki_formatting_test.rb'
|
- 'test/unit/lib/redmine/wiki_formatting_test.rb'
|
||||||
|
|||||||
@ -243,15 +243,15 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest
|
|||||||
def test_macro_collapse_should_not_break_toc
|
def test_macro_collapse_should_not_break_toc
|
||||||
set_language_if_valid 'en'
|
set_language_if_valid 'en'
|
||||||
|
|
||||||
text = <<-RAW
|
text = <<~RAW
|
||||||
{{toc}}
|
{{toc}}
|
||||||
|
|
||||||
h1. Title
|
h1. Title
|
||||||
|
|
||||||
{{collapse(Show example, Hide example)
|
{{collapse(Show example, Hide example)
|
||||||
h2. Heading
|
h2. Heading
|
||||||
}}"
|
}}"
|
||||||
RAW
|
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>'
|
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
|
end
|
||||||
|
|
||||||
def test_macros_should_not_be_executed_in_pre_tags
|
def test_macros_should_not_be_executed_in_pre_tags
|
||||||
text = <<-RAW
|
text = <<~RAW
|
||||||
{{hello_world(foo)}}
|
{{hello_world(foo)}}
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
{{hello_world(pre)}}
|
{{hello_world(pre)}}
|
||||||
!{{hello_world(pre)}}
|
!{{hello_world(pre)}}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
{{hello_world(bar)}}
|
{{hello_world(bar)}}
|
||||||
RAW
|
RAW
|
||||||
|
expected = <<~EXPECTED
|
||||||
|
<p>Hello world! Object: NilClass, Arguments: foo and no block of text.</p>
|
||||||
|
|
||||||
expected = <<-EXPECTED
|
<pre>
|
||||||
<p>Hello world! Object: NilClass, Arguments: foo and no block of text.</p>
|
{{hello_world(pre)}}
|
||||||
|
!{{hello_world(pre)}}
|
||||||
<pre>
|
</pre>
|
||||||
{{hello_world(pre)}}
|
|
||||||
!{{hello_world(pre)}}
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p>Hello world! Object: NilClass, Arguments: bar and no block of text.</p>
|
|
||||||
EXPECTED
|
|
||||||
|
|
||||||
|
<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]}, '')
|
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -386,21 +384,19 @@ EXPECTED
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_macros_with_text_should_not_mangle_following_macros
|
def test_macros_with_text_should_not_mangle_following_macros
|
||||||
text = <<-RAW
|
text = <<~RAW
|
||||||
{{hello_world
|
{{hello_world
|
||||||
Line of text
|
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
|
|
||||||
|
|
||||||
|
{{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]}, '')
|
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user