From 5e99c1807382463dd403e9611581d03af52cfd4c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 30 Aug 2011 05:05:23 +0000 Subject: [PATCH] remove trailing white-spaces from test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6759 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../wiki_formatting/textile_formatter_test.rb | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 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 7314d4880..f226fca4e 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -1,16 +1,16 @@ # Redmine - project management software -# Copyright (C) 2006-2010 Jean-Philippe Lang +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -22,7 +22,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase def setup @formatter = Redmine::WikiFormatting::Textile::Formatter end - + MODIFIERS = { "*" => 'strong', # bold "_" => 'em', # italic @@ -31,7 +31,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase "^" => 'sup', # superscript "~" => 'sub' # subscript } - + def test_modifiers assert_html_output( '*bold*' => 'bold', @@ -46,7 +46,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase '*(foo)two words*' => 'two words' ) end - + def test_modifiers_combination MODIFIERS.each do |m1, tag1| MODIFIERS.each do |m2, tag2| @@ -57,7 +57,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase end end end - + def test_inline_code assert_html_output( 'this is @some code@' => 'this is some code', @@ -76,14 +76,14 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase 'h1. 2009\02\09' => '

2009\02\09

' }, false) end - + def test_double_dashes_should_not_strikethrough assert_html_output( 'double -- dashes -- test' => 'double -- dashes -- test', 'double -- *dashes* -- test' => 'double -- dashes -- test' ) end - + def test_acronyms assert_html_output( 'this is an acronym: GPL(General Public License)' => 'this is an acronym: GPL', @@ -91,7 +91,7 @@ class Redmine::WikiFormatting::TextileFormatterTest < ActionView::TestCase 'GPL(This is a double-quoted "title")' => 'GPL' ) end - + def test_blockquote # orig raw text raw = <<-RAW @@ -108,7 +108,7 @@ John said: He's right. RAW - + # expected html expected = <<-EXPECTED

John said:

@@ -128,10 +128,10 @@ Nullam commodo metus accumsan nulla. Curabitur lobortis dui id dolor.

He's right.

EXPECTED - + assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') end - + def test_table raw = <<-RAW This is a table with empty cells: @@ -153,7 +153,7 @@ EXPECTED assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') end - + def test_table_with_line_breaks raw = <<-RAW This is a table with line breaks: @@ -192,19 +192,19 @@ EXPECTED assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') end - + def test_textile_should_not_mangle_brackets assert_equal '

[msg1][msg2]

', to_html('[msg1][msg2]') end - + private - + def assert_html_output(to_test, expect_paragraph = true) to_test.each do |text, expected| assert_equal(( expect_paragraph ? "

#{expected}

" : expected ), @formatter.new(text).to_html, "Formatting the following text failed:\n===\n#{text}\n===\n") end end - + def to_html(text) @formatter.new(text).to_html end