Add test for custom markup engine

This required adding a file to the example repo, so some of the tests'
expected hash values changed accordingly.
This commit is contained in:
James Dabbs
2013-02-25 21:06:00 -05:00
parent 62601f1adc
commit e3acef0e91
10 changed files with 20 additions and 4 deletions
+14
View File
@@ -236,4 +236,18 @@ if $METADATA
end
end
end
context "with custom markup engines" do
setup do
Gollum::Markup.register(:redacted, "Redacted", :regexp => /rd/) { |content| content.gsub /\S/, '-' }
@wiki = Gollum::Wiki.new(testpath("examples/lotr.git"))
end
test "should use the specified engine" do
page = @wiki.page('Riddles')
assert_equal :redacted, page.format
assert page.raw_data.include? 'Time'
assert page.raw_data =~ /^[\s\-]*$/
end
end