Patch #30347

test_links_separated_with_line_break_should_link tests nothing

Added by Yuichi HARADA 11 months ago. Updated 11 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.1.0

Description

Since Redmine::WikiFormattingTest#test_links_separated_with_line_break_should_link ( source:trunk/test/unit/lib/redmine/wiki_formatting_test.rb#L57 ) does not have an assert method, the test is not executed.

$ bundle exec rake test TEST=test/unit/lib/redmine/wiki_formatting_test.rb:57
Run options: --seed 9224

# Running:

.

Finished in 0.023977s, 41.7066 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 0 errors, 0 skips
$

I made a patch, and attach it.

diff --git a/test/unit/lib/redmine/wiki_formatting_test.rb b/test/unit/lib/redmine/wiki_formatting_test.rb
index b460bad35..6f05d3ef9 100644
--- a/test/unit/lib/redmine/wiki_formatting_test.rb
+++ b/test/unit/lib/redmine/wiki_formatting_test.rb
@@ -64,14 +64,15 @@ DIFF
 <p>link: <a class="external" href="https://www.redmine.org">https://www.redmine.org</a><br />
 <a class="external" href="http://www.redmine.org">http://www.redmine.org</a></p>
 EXPECTED
-
+
+    assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
   end

   def test_supports_section_edit
     with_settings :text_formatting => 'textile' do
       assert_equal true, Redmine::WikiFormatting.supports_section_edit?
     end
-
+
     with_settings :text_formatting => '' do
       assert_equal false, Redmine::WikiFormatting.supports_section_edit?
     end

append_assert.patch Magnifier (919 Bytes) Yuichi HARADA, 2019-01-07 06:52

Associated revisions

Revision 17785
Added by Go MAEDA 11 months ago

Redmine::WikiFormattingTest#test_links_separated_with_line_break_should_link tests nothing (#30347).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 11 months ago

  • Subject changed from Test is do nothing to test_links_separated_with_line_break_should_link checks nothing
  • Target version set to 4.1.0

LGTM. Setting the target version to 4.1.0.

#2 Updated by Go MAEDA 11 months ago

  • Subject changed from test_links_separated_with_line_break_should_link checks nothing to test_links_separated_with_line_break_should_link tests nothing
  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed. Thanks.

Also available in: Atom PDF