@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|||||||
s.add_development_dependency('shoulda')
|
s.add_development_dependency('shoulda')
|
||||||
s.add_development_dependency('rack-test')
|
s.add_development_dependency('rack-test')
|
||||||
s.add_development_dependency('wikicloth')
|
s.add_development_dependency('wikicloth')
|
||||||
|
s.add_development_dependency('rake')
|
||||||
|
|
||||||
# = MANIFEST =
|
# = MANIFEST =
|
||||||
s.files = %w[
|
s.files = %w[
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ def commit_details
|
|||||||
:email => "tom@github.com" }
|
:email => "tom@github.com" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def normal(text)
|
||||||
|
text.gsub!(' ', '')
|
||||||
|
text.gsub!("\n", '')
|
||||||
|
text
|
||||||
|
end
|
||||||
|
|
||||||
# test/spec/mini 3
|
# test/spec/mini 3
|
||||||
# http://gist.github.com/25455
|
# http://gist.github.com/25455
|
||||||
# chris@ozmm.org
|
# chris@ozmm.org
|
||||||
|
|||||||
+5
-5
@@ -173,7 +173,7 @@ context "Markup" do
|
|||||||
@wiki.write_page("Potato", :mediawiki, "a [[Potato|Potato Heaad]] ", commit_details)
|
@wiki.write_page("Potato", :mediawiki, "a [[Potato|Potato Heaad]] ", commit_details)
|
||||||
page = @wiki.page("Potato")
|
page = @wiki.page("Potato")
|
||||||
output = page.formatted_data
|
output = page.formatted_data
|
||||||
assert_equal "<p>\na <a class=\"internal present\" href=\"/Potato\">Potato Heaad</a> </p>", output
|
assert_equal normal("<p>\na <a class=\"internal present\" href=\"/Potato\">Potato Heaad</a> </p>"), normal(output)
|
||||||
end
|
end
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
@@ -476,8 +476,8 @@ context "Markup" do
|
|||||||
test "id prefix added" do
|
test "id prefix added" do
|
||||||
content = "h2(#foo). xxxx[1]\n\nfn1.footnote"
|
content = "h2(#foo). xxxx[1]\n\nfn1.footnote"
|
||||||
output = "<h2 id=\"wiki-foo\">xxxx" +
|
output = "<h2 id=\"wiki-foo\">xxxx" +
|
||||||
"<sup class=\"footnote\"><a href=\"#wiki-fn1\">1</a></sup></h2>" +
|
"<sup class=\"footnote\" id=\"wiki-fnr1\"><a href=\"#wiki-fn1\">1</a></sup></h2>" +
|
||||||
"\n<p class=\"footnote\" id=\"wiki-fn1\"><sup>1</sup> footnote</p>"
|
"\n<p class=\"footnote\" id=\"wiki-fn1\"><a href=\"#wiki-fnr1\"><sup>1</sup></a> footnote</p>"
|
||||||
compare(content, output, :textile)
|
compare(content, output, :textile)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -513,7 +513,7 @@ context "Markup" do
|
|||||||
page = @wiki.page("Bilbo Baggins")
|
page = @wiki.page("Bilbo Baggins")
|
||||||
rendered = Gollum::Markup.new(page).render
|
rendered = Gollum::Markup.new(page).render
|
||||||
if regexes.empty?
|
if regexes.empty?
|
||||||
assert_equal output, rendered
|
assert_equal normal(output), normal(rendered)
|
||||||
else
|
else
|
||||||
regexes.each { |r| assert_match r, output }
|
regexes.each { |r| assert_match r, output }
|
||||||
end
|
end
|
||||||
@@ -528,6 +528,6 @@ context "Markup" do
|
|||||||
@wiki.clear_cache
|
@wiki.clear_cache
|
||||||
page = @wiki.page("Bilbo Baggins")
|
page = @wiki.page("Bilbo Baggins")
|
||||||
rendered = Gollum::Markup.new(page).render
|
rendered = Gollum::Markup.new(page).render
|
||||||
assert_equal output, rendered
|
assert_equal normal(output), normal(rendered)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user