Sha256: e2a523ae6012d7e945402533c95be6dd6a71fab88c1d069478ed757d56157aff

Contents?: true

Size: 795 Bytes

Versions: 12

Compression:

Stored size: 795 Bytes

Contents

require "test_helper"

AutolinkFilter = HTML::Pipeline::AutolinkFilter

class HTML::Pipeline::AutolinkFilterTest < Test::Unit::TestCase
  def test_uses_rinku_for_autolinking
    # just try to parse a complicated piece of HTML
    # that Rails auto_link cannot handle
    assert_equal '<p>"<a href="http://www.github.com">http://www.github.com</a>"</p>',
      AutolinkFilter.to_html('<p>"http://www.github.com"</p>')
  end

  def test_autolink_option
    assert_equal '<p>"http://www.github.com"</p>',
      AutolinkFilter.to_html('<p>"http://www.github.com"</p>', :autolink => false)
  end

  def test_autolink_flags
    assert_equal '<p>"<a href="http://github">http://github</a>"</p>',
      AutolinkFilter.to_html('<p>"http://github"</p>', :flags => Rinku::AUTOLINK_SHORT_DOMAINS)
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
html-pipeline-0.0.14 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.13 test/html/pipeline/autolink_filter_test.rb
geothird-html-pipeline-0.0.12 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.12 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.11 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.10 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.8 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.7 test/html/pipeline/autolink_filter_test.rb
html-pipeline-no-charlock-0.0.6 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.6 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.5 test/html/pipeline/autolink_filter_test.rb
html-pipeline-0.0.4 test/html/pipeline/autolink_filter_test.rb