From 7adf05810a192107e74348ec24fea0297cb9c026 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 12 Mar 2010 15:17:53 +0000 Subject: [PATCH] Refactors textile formatting tests. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3568 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../wiki_formatting/textile_formatter_test.rb | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index 66e588ffb..e34c273b3 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -33,7 +33,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase } def test_modifiers - to_test = { + assert_html_output( '*bold*' => 'bold', 'before *bold*' => 'before bold', '*bold* after' => 'bold after', @@ -43,11 +43,8 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase '*two* *words*' => 'two words', '*(two)* *(words)*' => '(two) (words)', # with class - '*(foo)two words*' => 'two words', - } - to_test.each do |text, expected| - assert_equal "

#{expected}

", @formatter.new(text).to_html - end + '*(foo)two words*' => 'two words' + ) end def test_modifiers_combination @@ -56,25 +53,27 @@ class Redmine::WikiFormatting::TextileFormatterTest < HelperTestCase next if m1 == m2 text = "#{m2}#{m1}Phrase modifiers#{m1}#{m2}" html = "

<#{tag2}><#{tag1}>Phrase modifiers

" - assert_equal html, @formatter.new(text).to_html + assert_html_output text => html end end end def test_inline_code - to_test = { + assert_html_output( 'this is @some code@' => 'this is some code', - '@@' => '<Location /redmine>', - } - to_test.each do |text, expected| - assert_equal "

#{expected}

", @formatter.new(text).to_html - end + '@@' => '<Location /redmine>' + ) end def test_escaping - to_test = { - 'this is a