Sha256: b39e6e75baee2743b2bcf3cbed79200851333a86ec0dedc5e092879e50f0ecfb

Contents?: true

Size: 1.14 KB

Versions: 22

Compression:

Stored size: 1.14 KB

Contents

require 'helper'

class Nanoc::Filters::PandocTest < Nanoc::TestCase
  def test_filter
    if_have 'pandoc-ruby' do
      skip_unless_have_command 'pandoc'

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

      # Run filter
      result = filter.setup_and_run("# Heading\n")
      assert_match(%r{<h1 id=\"heading\">Heading</h1>\s*}, result)
    end
  end

  def test_params_old
    if_have 'pandoc-ruby' do
      skip_unless_have_command 'pandoc'

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

      # Run filter
      args = { f: :markdown, to: :html }
      result = filter.setup_and_run("# Heading\n", args)
      assert_match(%r{<h1 id=\"heading\">Heading</h1>\s*}, result)
    end
  end

  def test_params_new
    if_have 'pandoc-ruby' do
      skip_unless_have_command 'pandoc'

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

      # Run filter
      args = [:s, { f: :markdown, to: :html }, 'no-wrap', :toc]
      result = filter.setup_and_run("# Heading\n", args: args)
      assert_match '<div id="TOC">', result
      assert_match(%r{<h1 id=\"heading\">Heading</h1>\s*}, result)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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