Sha256: b6000eabac69e9b0b4ec88a2d4be72945d8a3d3e29c27b07999b21c2b4024800

Contents?: true

Size: 647 Bytes

Versions: 10

Compression:

Stored size: 647 Bytes

Contents

require "test_helper"

SyntaxHighlightFilter = HTML::Pipeline::SyntaxHighlightFilter

class HTML::Pipeline::SyntaxHighlightFilterTest < Test::Unit::TestCase
  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

10 entries across 10 versions & 1 rubygems

Version Path
html-pipeline-1.8.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.7.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.6.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.5.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.4.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.3.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.1.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-1.0.0 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-0.3.1 test/html/pipeline/syntax_highlight_filter_test.rb
html-pipeline-0.3.0 test/html/pipeline/syntax_highlight_filter_test.rb