Sha256: 48d261950dad38fbd4f0dad358741e2fd1359f5d6a080a439b21a361d10ed3b2
Contents?: true
Size: 1.57 KB
Versions: 5
Compression:
Stored size: 1.57 KB
Contents
# coding: UTF-8 require 'test_helper' class SmartyHTMLTest < Greenmat::TestCase def setup @renderer = Greenmat::Render::SmartyHTML end def test_that_smartyhtml_converts_single_quotes markdown = render("They're not for sale.") assert_equal "<p>They’re not for sale.</p>", markdown end def test_that_smartyhtml_converts_double_quotes rd = render(%("Quoted text")) assert_equal %(<p>“Quoted text”</p>), rd end def test_that_smartyhtml_converts_double_hyphen rd = render("double hyphen -- ndash") assert_equal "<p>double hyphen – ndash</p>", rd end def test_that_smartyhtml_converts_triple_hyphen rd = render("triple hyphen --- mdash") assert_equal "<p>triple hyphen — mdash</p>", rd end def test_that_smartyhtml_ignores_double_hyphen_in_code rd = render("double hyphen in `--option`") assert_equal "<p>double hyphen in <code>--option</code></p>", rd end def test_that_smartyhtml_ignores_pre rd = render(" It's a test of \"pre\"\n") expected = "It's a test of "pre"" assert rd.include?(expected), "\"#{rd}\" should contain \"#{expected}\"" end def test_that_smartyhtml_ignores_code rd = render("`It's a test of \"code\"`\n") expected = "It's a test of "code"" assert rd.include?(expected), "\"#{rd}\" should contain \"#{expected}\"" end def test_that_smartyhtml_ignores_links_for_single_quotes output = render("[John](link)'s cat") expected = %(<p><a href="link">John</a>’s cat</p>) assert_equal expected, output end end
Version data entries
5 entries across 5 versions & 1 rubygems