From d51a82903858ba8da48334123183703829795896 Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Tue, 19 Jul 2011 12:54:13 -0700 Subject: [PATCH 1/3] rake is needed to run the tests in dev --- gollum.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/gollum.gemspec b/gollum.gemspec index 5714e44c..cde331bc 100644 --- a/gollum.gemspec +++ b/gollum.gemspec @@ -37,6 +37,7 @@ Gem::Specification.new do |s| s.add_development_dependency('shoulda') s.add_development_dependency('rack-test') s.add_development_dependency('wikicloth') + s.add_development_dependency('rake') # = MANIFEST = s.files = %w[ From 5a7659e1c39b9e83377df79a80997893c6b7074f Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Tue, 19 Jul 2011 12:55:19 -0700 Subject: [PATCH 2/3] fix tests breaking due to whitespace issues --- test/helper.rb | 6 ++++++ test/test_markup.rb | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index bde85157..78189633 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -38,6 +38,12 @@ def commit_details :email => "tom@github.com" } end +def normal(text) + text.gsub!(' ', '') + text.gsub!("\n", '') + text +end + # test/spec/mini 3 # http://gist.github.com/25455 # chris@ozmm.org diff --git a/test/test_markup.rb b/test/test_markup.rb index ffe6364f..2ad76088 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -173,7 +173,7 @@ context "Markup" do @wiki.write_page("Potato", :mediawiki, "a [[Potato|Potato Heaad]] ", commit_details) page = @wiki.page("Potato") output = page.formatted_data - assert_equal "

\na Potato Heaad

", output + assert_equal normal("

\na Potato Heaad

"), normal(output) end ######################################################################### @@ -513,7 +513,7 @@ context "Markup" do page = @wiki.page("Bilbo Baggins") rendered = Gollum::Markup.new(page).render if regexes.empty? - assert_equal output, rendered + assert_equal normal(output), normal(rendered) else regexes.each { |r| assert_match r, output } end @@ -528,6 +528,6 @@ context "Markup" do @wiki.clear_cache page = @wiki.page("Bilbo Baggins") rendered = Gollum::Markup.new(page).render - assert_equal output, rendered + assert_equal normal(output), normal(rendered) end end From aa258dbe6b802dce4171f493bfc76d56819457ad Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Tue, 19 Jul 2011 12:55:43 -0700 Subject: [PATCH 3/3] fix test breaking due to new footnote anchor --- test/test_markup.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_markup.rb b/test/test_markup.rb index 2ad76088..988a34d4 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -476,8 +476,8 @@ context "Markup" do test "id prefix added" do content = "h2(#foo). xxxx[1]\n\nfn1.footnote" output = "

xxxx" + - "1

" + - "\n

1 footnote

" + "1" + + "\n

1 footnote

" compare(content, output, :textile) end