# 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("

They're not for sale.

") assert_equal "

They’re not for sale.

", markdown end def test_that_smart_converts_single_quotes_in_words_that_end_in_ll markdown = @pants.render("

Well that'll be the day

") assert_equal "

Well that’ll be the day

", markdown end def test_that_smart_converts_double_quotes_to_curly_quotes rd = @pants.render(%(

"Quoted text"

)) assert_equal %(

“Quoted text”

), rd end def test_that_smart_gives_ve_suffix_a_rsquo rd = @pants.render("

I've been meaning to tell you ..

") assert_equal "

I’ve been meaning to tell you ..

", rd end def test_that_smart_gives_m_suffix_a_rsquo rd = @pants.render("

I'm not kidding

") assert_equal "

I’m not kidding

", rd end def test_that_smart_gives_d_suffix_a_rsquo rd = @pants.render("

what'd you say?

") assert_equal "

what’d you say?

", rd end def test_that_backticks_are_preserved rd = @pants.render("

single `backticks` in HTML should be preserved

") assert_equal "

single `backticks` in HTML should be preserved

", rd end end