Sha256: 33e9bc8481326d430d3963a13231cae00c789bdd76db1f5444e16ac77babff18

Contents?: true

Size: 679 Bytes

Versions: 22

Compression:

Stored size: 679 Bytes

Contents

require 'helper'

class Nanoc::Filters::ColorizeSyntax::SimonTest < Nanoc::TestCase
  def test_simon_highlight
    if_have 'nokogiri' do
      skip_unless_have_command 'highlight'

      # Create filter
      filter = ::Nanoc::Filters::ColorizeSyntax.new

      # Get input and expected output
      input = %(<pre title="moo"><code class="language-ruby">
# comment
</code></pre>)
      expected_output = '<pre title="moo"><code class="language-ruby"><span class="hl slc"># comment</span></code></pre>'

      # Run filter
      actual_output = filter.setup_and_run(input, default_colorizer: :simon_highlight)
      assert_equal(expected_output, actual_output)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
nanoc-4.7.9 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.8 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.7 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.6 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.5 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.4 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.3 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.2 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.1 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.0 test/filters/colorize_syntax/test_simon.rb
nanoc-4.6.4 test/filters/colorize_syntax/test_simon.rb
nanoc-4.6.3 test/filters/colorize_syntax/test_simon.rb
nanoc-4.6.2 test/filters/colorize_syntax/test_simon.rb
nanoc-4.6.1 test/filters/colorize_syntax/test_simon.rb
nanoc-4.6.0 test/filters/colorize_syntax/test_simon.rb
nanoc-4.5.4 test/filters/colorize_syntax/test_simon.rb
nanoc-4.5.3 test/filters/colorize_syntax/test_simon.rb
nanoc-4.5.2 test/filters/colorize_syntax/test_simon.rb
nanoc-4.5.1 test/filters/colorize_syntax/test_simon.rb
nanoc-4.5.0 test/filters/colorize_syntax/test_simon.rb