Remove :header_hashtags option and adjust tests
This commit is contained in:
+4
-18
@@ -92,14 +92,14 @@ end
|
||||
context "Wiki page previewing" do
|
||||
setup do
|
||||
@path = testpath("examples/lotr.git")
|
||||
Gollum::Wiki.default_options = {:header_hashtags => false, :universal_toc => false}
|
||||
Gollum::Wiki.default_options = {:universal_toc => false}
|
||||
@wiki = Gollum::Wiki.new(@path)
|
||||
end
|
||||
|
||||
test "preview_page" do
|
||||
page = @wiki.preview_page("Test", "# Bilbo", :markdown)
|
||||
assert_equal "# Bilbo", page.raw_data
|
||||
assert_equal "<h1>Bilbo</h1>", page.formatted_data
|
||||
assert_equal %Q{<h1>Bilbo<a class="anchor" id="Bilbo" href="#Bilbo"></a>\n</h1>}, page.formatted_data
|
||||
assert_equal "Test.md", page.filename
|
||||
assert_equal "Test", page.name
|
||||
end
|
||||
@@ -108,32 +108,18 @@ end
|
||||
context "Wiki TOC" do
|
||||
setup do
|
||||
@path = testpath("examples/lotr.git")
|
||||
options = {:header_hashtags => false, :universal_toc => true}
|
||||
options = {:universal_toc => true}
|
||||
@wiki = Gollum::Wiki.new(@path, options)
|
||||
end
|
||||
|
||||
test "toc_generation" do
|
||||
page = @wiki.preview_page("Test", "# Bilbo", :markdown)
|
||||
assert_equal "# Bilbo", page.raw_data
|
||||
assert_equal '<h1><a class="anchor" id="Bilbo" href="#Bilbo"></a>Bilbo</h1>', page.formatted_data.gsub(/\n/,"")
|
||||
assert_equal '<h1>Bilbo<a class="anchor" id="Bilbo" href="#Bilbo"></a></h1>', page.formatted_data.gsub(/\n/,"")
|
||||
assert_equal '<ul><li><a href="#Bilbo">Bilbo</a></li></ul>', page.toc_data.gsub(/\n */,"")
|
||||
end
|
||||
end
|
||||
|
||||
context "Wiki header hashtags" do
|
||||
setup do
|
||||
@path = testpath("examples/lotr.git")
|
||||
options = {:header_hashtags => true, :universal_toc => false}
|
||||
@wiki = Gollum::Wiki.new(@path, options)
|
||||
end
|
||||
|
||||
test "header_hashtags" do
|
||||
page = @wiki.preview_page("Test", "# Bilbo", :markdown)
|
||||
assert_equal "# Bilbo", page.raw_data
|
||||
assert_equal '<h1><a class="anchor" id="Bilbo" href="#Bilbo"></a>Bilbo</h1>', page.formatted_data.gsub(/\n/,"")
|
||||
end
|
||||
end
|
||||
|
||||
context "Wiki page writing" do
|
||||
setup do
|
||||
@path = testpath("examples/test.git")
|
||||
|
||||
Reference in New Issue
Block a user