Sha256: 83abea69be68afd1cf758780ec6fb85f170d208361027ef3e6be3610749c938e

Contents?: true

Size: 1.39 KB

Versions: 16

Compression:

Stored size: 1.39 KB

Contents

# coding: UTF-8
require 'test_helper'

class SmartyPantsTest < Test::Unit::TestCase
  def setup
    @pants = Redcarpet::Render::SmartyPants
  end

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

  def test_that_smart_converts_single_quotes_in_words_that_end_in_ll
    markdown = @pants.render("<p>Well that'll be the day</p>")
    assert_equal "<p>Well that&rsquo;ll be the day</p>", markdown
  end

  def test_that_smart_converts_double_quotes_to_curly_quotes
    rd = @pants.render(%(<p>"Quoted text"</p>))
    assert_equal %(<p>&ldquo;Quoted text&rdquo;</p>), rd
  end

  def test_that_smart_gives_ve_suffix_a_rsquo
    rd = @pants.render("<p>I've been meaning to tell you ..</p>")
    assert_equal "<p>I&rsquo;ve been meaning to tell you ..</p>", rd
  end

  def test_that_smart_gives_m_suffix_a_rsquo
    rd = @pants.render("<p>I'm not kidding</p>")
    assert_equal "<p>I&rsquo;m not kidding</p>", rd
  end

  def test_that_smart_gives_d_suffix_a_rsquo
    rd = @pants.render("<p>what'd you say?</p>")
    assert_equal "<p>what&rsquo;d you say?</p>", rd
  end

  def test_that_backticks_are_preserved
    rd = @pants.render("<p>single `backticks` in HTML should be preserved</p>")
    assert_equal "<p>single `backticks` in HTML should be preserved</p>", rd
  end
end

Version data entries

16 entries across 13 versions & 3 rubygems

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