mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Test all the things
This commit is contained in:
@@ -31,9 +31,32 @@ class TestFilters < JekyllUnitTest
|
||||
assert_equal "<p>something <strong>really</strong> simple</p>\n", @filter.markdownify("something **really** simple")
|
||||
end
|
||||
|
||||
should "smartify with simple string" do
|
||||
assert_equal "SmartyPants is *not* Markdown", @filter.smartify("SmartyPants is *not* Markdown")
|
||||
assert_equal "“This filter’s test…”", @filter.smartify(%q{"This filter's test..."})
|
||||
context "smartify filter" do
|
||||
should "convert quotes and typographic characters" do
|
||||
assert_equal "SmartyPants is *not* Markdown", @filter.smartify("SmartyPants is *not* Markdown")
|
||||
assert_equal "“This filter’s test…”", @filter.smartify(%q{"This filter's test..."})
|
||||
end
|
||||
|
||||
should "escapes special characters when configured to do so" do
|
||||
kramdown = JekyllFilter.new({:kramdown => {:entity_output => :symbolic}})
|
||||
assert_equal "“This filter’s test…”", kramdown.smartify(%q{"This filter's test..."})
|
||||
end
|
||||
|
||||
should "convert HTML entities to unicode characters" do
|
||||
assert_equal "’", @filter.smartify("’")
|
||||
assert_equal "“", @filter.smartify("“")
|
||||
end
|
||||
|
||||
should "allow raw HTML passthrough" do
|
||||
assert_equal "Span HTML is <em>not</em> escaped", @filter.smartify("Span HTML is <em>not</em> escaped")
|
||||
assert_equal "<div>Block HTML is not escaped</div>", @filter.smartify("<div>Block HTML is not escaped</div>")
|
||||
end
|
||||
|
||||
should "escape special characters" do
|
||||
assert_equal "3 < 4", @filter.smartify("3 < 4")
|
||||
assert_equal "5 > 4", @filter.smartify("5 > 4")
|
||||
assert_equal "This & that", @filter.smartify("This & that")
|
||||
end
|
||||
end
|
||||
|
||||
should "sassify with simple string" do
|
||||
|
||||
Reference in New Issue
Block a user