Sha256: 95e5806c4de5efbf5a8a863eeca09647044005c7b5b0ddb25a00baad62d9b9ee

Contents?: true

Size: 537 Bytes

Versions: 17

Compression:

Stored size: 537 Bytes

Contents

require 'test_helper'

class HTML::Pipeline::EmojiFilterTest < Test::Unit::TestCase
  EmojiFilter = HTML::Pipeline::EmojiFilter
  
  def test_emojify
    filter = EmojiFilter.new("<p>:shipit:</p>", {:asset_root => 'https://foo.com'})
    doc = filter.call
    assert_match "https://foo.com/emoji/shipit.png", doc.search('img').attr('src').value
  end
  
  def test_required_context_validation
    exception = assert_raise(ArgumentError) { 
      EmojiFilter.call("", {}) 
    }
    assert_match /:asset_root/, exception.message
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
html-pipeline-1.0.0 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.3.1 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.3.0 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.2.1 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.2.0 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.1.0 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.14 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.13 test/html/pipeline/emoji_filter_test.rb
geothird-html-pipeline-0.0.12 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.12 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.11 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.10 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.8 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.7 test/html/pipeline/emoji_filter_test.rb
html-pipeline-no-charlock-0.0.6 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.6 test/html/pipeline/emoji_filter_test.rb
html-pipeline-0.0.5 test/html/pipeline/emoji_filter_test.rb