Sha256: ae9aa1fc518354a1bd635051b853a9b1b93eafacb28952116819b1b7615d837f

Contents?: true

Size: 1018 Bytes

Versions: 13

Compression:

Stored size: 1018 Bytes

Contents

# coding: UTF-8
require 'test_helper'

class SmartyHTMLTest < Test::Unit::TestCase
  def setup
    @smarty_markdown = Redcarpet::Markdown.new(Redcarpet::Render::SmartyHTML)
  end

  def test_that_smartyhtml_converts_single_quotes
    markdown = @smarty_markdown.render("They're not for sale.")
    assert_equal "<p>They&rsquo;re not for sale.</p>\n", markdown
  end

  def test_that_smartyhtml_converts_double_quotes
    rd = @smarty_markdown.render(%("Quoted text"))
    assert_equal %(<p>&ldquo;Quoted text&rdquo;</p>\n), rd
  end

  def test_that_smartyhtml_ignores_pre
    rd = @smarty_markdown.render("    It's a test of \"pre\"\n")
    expected = "It&#39;s a test of &quot;pre&quot;"
    assert rd.include?(expected), "\"#{rd}\" should contain \"#{expected}\""
  end

  def test_that_smartyhtml_ignores_code
    rd = @smarty_markdown.render("`It's a test of \"code\"`\n")
    expected = "It&#39;s a test of &quot;code&quot;"
    assert rd.include?(expected), "\"#{rd}\" should contain \"#{expected}\""
  end
end

Version data entries

13 entries across 10 versions & 3 rubygems

Version Path
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/redcarpet-3.0.0/test/smarty_html_test.rb
candlepin-api-0.4.0 bundle/ruby/gems/redcarpet-2.3.0/test/smarty_html_test.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/redcarpet-2.3.0/test/smarty_html_test.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/redcarpet-2.3.0/test/smarty_html_test.rb
redcarpet-3.0.0 test/smarty_html_test.rb
redcarpet-2.3.0 test/smarty_html_test.rb