Sha256: 8754689dc1730949e8d576c953cd02d5bdf330fa02e48b55af71fc010e2845d1

Contents?: true

Size: 710 Bytes

Versions: 18

Compression:

Stored size: 710 Bytes

Contents

# frozen_string_literal: true

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

18 entries across 18 versions & 1 rubygems

Version Path
nanoc-4.8.12 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.11 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.10 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.9 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.8 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.7 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.6 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.5 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.4 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.3 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.2 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.1 test/filters/colorize_syntax/test_simon.rb
nanoc-4.8.0 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.14 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.13 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.12 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.11 test/filters/colorize_syntax/test_simon.rb
nanoc-4.7.10 test/filters/colorize_syntax/test_simon.rb