test/tilt_markdown_test.rb in tilt-1.3.2 vs test/tilt_markdown_test.rb in tilt-1.3.3
- old
+ new
@@ -1,7 +1,9 @@
# coding: UTF-8
require 'tilt'
+
+begin
require 'nokogiri'
module MarkdownTests
def self.included(mod)
class << mod
@@ -89,10 +91,17 @@
require 'redcarpet'
class MarkdownRedcarpetTest < Test::Unit::TestCase
include MarkdownTests
template Tilt::RedcarpetTemplate
+ # Doesn't support escaping
+ undef test_escape_html_true
+
+ def test_smarty_pants_true
+ html = nrender "Hello ``World'' -- This is --- a test ...", :smartypants => true
+ assert_equal "<p>Hello “World” – This is — a test …</p>", html
+ end
end
rescue LoadError => boom
# It should already be warned in the main tests
end
@@ -141,8 +150,12 @@
undef test_smart_quotes
undef test_smart_quotes_false
end
rescue LoadError => boom
# It should already be warned in the main tests
+end
+
+rescue LoadError
+ warn "Markdown tests need Nokogiri\n"
end