Sha256: 1801e41bc69f3dd1ca2765389b32bc599f3a0f3ea418be613f9accd7e3fb4665

Contents?: true

Size: 877 Bytes

Versions: 2

Compression:

Stored size: 877 Bytes

Contents

require File.expand_path('../../unit_test_helper', __FILE__)

class RedcarpetTest < Test::Unit::TestCase

  def test_transform_strong
    result = auto_html("This is **my** text.") { redcarpet }
    assert_equal '<p>This is <strong>my</strong> text.</p>'+"\n", result
  end

  def test_transform_title
    result = auto_html("## This is a title ##") { redcarpet }
    assert_equal '<h2>This is a title</h2>'+"\n", result
  end

  def test_transform_link
    result = auto_html('[This is a link](http://example.org/)') { redcarpet }
    assert_equal '<p><a href="http://example.org/">This is a link</a></p>'+"\n", result
  end

  def test_transform_link_target_blank
    result = auto_html('[This is a link](http://example.org/)') { redcarpet :target => :_blank }
    assert_equal '<p><a target="_blank" href="http://example.org/">This is a link</a></p>'+"\n", result
  end

end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
marcosinger-auto_html-1.3.6 test/unit/filters/redcarpet_test.rb
auto_html-1.4.2 test/unit/filters/redcarpet_test.rb