Fix metadata tests

This commit is contained in:
bootstraponline
2013-01-08 17:09:21 -05:00
parent 1c7a481ed9
commit 78e4dfbece
4 changed files with 9 additions and 3 deletions
+3
View File
@@ -13,6 +13,9 @@ ENV['RACK_ENV'] = 'test'
require 'gollum' require 'gollum'
require 'gollum/frontend/app' require 'gollum/frontend/app'
# Disable the metadata feature
$METADATA = false
# Make sure we're in the test dir, the tests expect that to be the current # Make sure we're in the test dir, the tests expect that to be the current
# directory. # directory.
TEST_DIR = File.join(File.dirname(__FILE__), *%w[.]) TEST_DIR = File.join(File.dirname(__FILE__), *%w[.])
+2 -2
View File
@@ -627,7 +627,7 @@ np.array([[2,2],[1,3]],np.float)
assert_not_nil rendered.match(output) assert_not_nil rendered.match(output)
end end
######################################################################### if $METADATA #########################################################################
# #
# Metadata Blocks # Metadata Blocks
# #
@@ -677,7 +677,7 @@ np.array([[2,2],[1,3]],np.float)
assert_equal output, rendered assert_equal output, rendered
assert_equal result, page.metadata assert_equal result, page.metadata
end end
end # if $METADATA
######################################################################### #########################################################################
# #
# Various # Various
+2 -1
View File
@@ -228,11 +228,12 @@ context "within a sub-directory" do
assert page.footer.raw_data =~ /^Lord of the Rings/ assert page.footer.raw_data =~ /^Lord of the Rings/
end end
if $METADATA
test "get metadata on page" do test "get metadata on page" do
page = @wiki.page('Elrond') page = @wiki.page('Elrond')
assert_equal Gollum::Page, page.class assert_equal Gollum::Page, page.class
assert_equal 'elf', page.metadata['race'] assert_equal 'elf', page.metadata['race']
end end
end end
end
+2
View File
@@ -198,6 +198,7 @@ context "Wiki page writing" do
assert_equal cd[:email], @wiki.repo.commits.first.author.email assert_equal cd[:email], @wiki.repo.commits.first.author.email
end end
if $METADATA
test "page title override with metadata" do test "page title override with metadata" do
@wiki.write_page("Gollum", :markdown, "<!-- --- title: Over -->", commit_details) @wiki.write_page("Gollum", :markdown, "<!-- --- title: Over -->", commit_details)
@@ -205,6 +206,7 @@ context "Wiki page writing" do
assert_equal 'Over', page.url_path_title assert_equal 'Over', page.url_path_title
end end
end
test "update page with format change" do test "update page with format change" do
@wiki.write_page("Gollum", :markdown, "# Gollum", commit_details) @wiki.write_page("Gollum", :markdown, "# Gollum", commit_details)