nuke whitespace
This commit is contained in:
@@ -37,7 +37,7 @@ context "Wiki" do
|
||||
assert_equal committer, index
|
||||
end
|
||||
|
||||
res = wiki.write_page("Gollum", :markdown, "# Gollum",
|
||||
res = wiki.write_page("Gollum", :markdown, "# Gollum",
|
||||
:committer => committer)
|
||||
|
||||
assert_equal committer, res
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# ~*~ encoding: utf-8 ~*~
|
||||
path = File.join(File.dirname(__FILE__), "helper")
|
||||
path = File.join(File.dirname(__FILE__), "helper")
|
||||
require File.expand_path(path)
|
||||
|
||||
context "File" do
|
||||
|
||||
+2
-2
@@ -478,11 +478,11 @@ np.array([[2,2],[1,3]],np.float)
|
||||
test "sequence diagram blocks" do
|
||||
content = "a\n\n{{{default\nalice->bob: Test\n}}}\n\nb"
|
||||
output = /.*<img src="http:\/\/www\.websequencediagrams\.com\/\?img=\w{9}" \/>.*/
|
||||
|
||||
|
||||
index = @wiki.repo.index
|
||||
index.add("Bilbo-Baggins.md", content)
|
||||
index.commit("Add sequence diagram")
|
||||
|
||||
|
||||
page = @wiki.page("Bilbo Baggins")
|
||||
rendered = Gollum::Markup.new(page).render
|
||||
assert_not_nil rendered.match(output)
|
||||
|
||||
+5
-5
@@ -25,7 +25,7 @@ context "Page" do
|
||||
test "get existing page case insensitive" do
|
||||
assert_equal @wiki.page('Bilbo Baggins').path, @wiki.page('bilbo baggins').path
|
||||
end
|
||||
|
||||
|
||||
test "get existing page with hyphen" do
|
||||
assert_equal @wiki.page('Bilbo Baggins').path, @wiki.page('Bilbo-Baggins').path
|
||||
end
|
||||
@@ -33,19 +33,19 @@ context "Page" do
|
||||
test "get existing page with underscore" do
|
||||
assert_nil @wiki.page('Bilbo_Baggins')
|
||||
end
|
||||
|
||||
|
||||
test "get existing page where filename contains whitespace, with hypen" do
|
||||
assert_equal @wiki.page('Samwise Gamgee').path, @wiki.page('Samwise-Gamgee').path
|
||||
end
|
||||
|
||||
|
||||
test "get existing page where filename contains whitespace, with underscore" do
|
||||
assert_equal @wiki.page('Samwise Gamgee').path, @wiki.page('Samwise_Gamgee').path
|
||||
end
|
||||
|
||||
|
||||
test "get existing page where filename contains whitespace, with whitespace" do
|
||||
assert_equal @wiki.page('Samwise Gamgee').path, @wiki.page('Samwise Gamgee').path
|
||||
end
|
||||
|
||||
|
||||
test "get nested page" do
|
||||
page = @wiki.page('Eye Of Sauron')
|
||||
assert_equal 'Mordor/Eye-Of-Sauron.md', page.path
|
||||
|
||||
+9
-9
@@ -237,7 +237,7 @@ context "Wiki page writing with whitespace (filename contains whitespace)" do
|
||||
@path = cloned_testpath("examples/lotr.git")
|
||||
@wiki = Gollum::Wiki.new(@path)
|
||||
end
|
||||
|
||||
|
||||
test "update_page" do
|
||||
assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format
|
||||
assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename
|
||||
@@ -249,7 +249,7 @@ context "Wiki page writing with whitespace (filename contains whitespace)" do
|
||||
assert_equal "h1. Samwise Gamgee2", @wiki.page("Samwise Gamgee").raw_data
|
||||
assert_equal "Samwise Gamgee.textile", @wiki.page("Samwise Gamgee").filename
|
||||
end
|
||||
|
||||
|
||||
test "update page with format change, verify non-canonicalization of filename, where filename contains Whitespace" do
|
||||
assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format
|
||||
assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename
|
||||
@@ -261,7 +261,7 @@ context "Wiki page writing with whitespace (filename contains whitespace)" do
|
||||
assert_equal "h1. Samwise Gamgee", @wiki.page("Samwise Gamgee").raw_data
|
||||
assert_equal "Samwise Gamgee.textile", @wiki.page("Samwise Gamgee").filename
|
||||
end
|
||||
|
||||
|
||||
test "update page with name change, verify canonicalization of filename, where filename contains Whitespace" do
|
||||
assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format
|
||||
assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename
|
||||
@@ -269,10 +269,10 @@ context "Wiki page writing with whitespace (filename contains whitespace)" do
|
||||
page = @wiki.page("Samwise Gamgee")
|
||||
@wiki.update_page(page, 'Sam Gamgee', :textile, "h1. Samwise Gamgee", commit_details)
|
||||
|
||||
assert_equal "h1. Samwise Gamgee", @wiki.page("Sam Gamgee").raw_data
|
||||
assert_equal "h1. Samwise Gamgee", @wiki.page("Sam Gamgee").raw_data
|
||||
assert_equal "Sam-Gamgee.textile", @wiki.page("Sam Gamgee").filename
|
||||
end
|
||||
|
||||
|
||||
test "update page with name and format change, verify canonicalization of filename, where filename contains Whitespace" do
|
||||
assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format
|
||||
assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename
|
||||
@@ -283,8 +283,8 @@ context "Wiki page writing with whitespace (filename contains whitespace)" do
|
||||
assert_equal :textile, @wiki.page("Sam Gamgee").format
|
||||
assert_equal "h1. Samwise Gamgee", @wiki.page("Sam Gamgee").raw_data
|
||||
assert_equal "Sam-Gamgee.textile", @wiki.page("Sam Gamgee").filename
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_rf(@path)
|
||||
end
|
||||
@@ -382,7 +382,7 @@ context "Wiki sync with working directory (filename contains whitespace)" do
|
||||
@wiki.delete_page(page, commit_details)
|
||||
assert !File.exist?(File.join(@path, "Samwise Gamgee.mediawiki"))
|
||||
end
|
||||
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_r(@path)
|
||||
end
|
||||
@@ -401,7 +401,7 @@ context "page_file_dir option" do
|
||||
assert_equal "Hi", File.read(File.join(@path, @page_file_dir, "New-Page.md"))
|
||||
assert !File.exist?(File.join(@path, "New-Page.md"))
|
||||
end
|
||||
|
||||
|
||||
test "edit a page in a sub directory" do
|
||||
page = @wiki.page('foo')
|
||||
@wiki.update_page(page, page.name, page.format, 'new contents', commit_details)
|
||||
|
||||
Reference in New Issue
Block a user