Sha256: 61afba3c50866b02b4a40b708cae5435db73a3baf55784b55a7c5d9626811bf6

Contents?: true

Size: 641 Bytes

Versions: 13

Compression:

Stored size: 641 Bytes

Contents

require "test_helper"

SyntaxHighlightFilter = HTML::Pipeline::SyntaxHighlightFilter

class HTML::Pipeline::SyntaxHighlightFilterTest < Minitest::Test
  def test_highlight_default
    filter = SyntaxHighlightFilter.new \
      "<pre>hello</pre>", :highlight => "coffeescript"

    doc = filter.call
    assert !doc.css(".highlight-coffeescript").empty?
  end

  def test_highlight_default_will_not_override
    filter = SyntaxHighlightFilter.new \
      "<pre lang='c'>hello</pre>", :highlight => "coffeescript"

    doc = filter.call
    assert doc.css(".highlight-coffeescript").empty?
    assert !doc.css(".highlight-c").empty?
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
html-pipeline-2.4.1 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.4.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.3.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.2.4 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.2.3 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.2.2 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.2.1 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.2.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.1.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-2.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.11.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.10.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.9.0 test/html/pipeline/syntax_highlight_filter_test.rb