Sha256: 440bc0fc69d49b45ab8eb2c1fc838e995a57ee7cf7fc014e5d320a542b3231ed

Contents?: true

Size: 1.12 KB

Versions: 40

Compression:

Stored size: 1.12 KB

Contents

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

40 entries across 40 versions & 1 rubygems

Version Path
nanoc-4.4.5 test/filters/test_pandoc.rb
nanoc-4.4.4 test/filters/test_pandoc.rb
nanoc-4.4.3 test/filters/test_pandoc.rb
nanoc-4.4.2 test/filters/test_pandoc.rb
nanoc-4.4.1 test/filters/test_pandoc.rb
nanoc-4.4.0 test/filters/test_pandoc.rb
nanoc-4.3.8 test/filters/test_pandoc.rb
nanoc-4.3.7 test/filters/test_pandoc.rb
nanoc-4.3.6 test/filters/test_pandoc.rb
nanoc-4.3.5 test/filters/test_pandoc.rb
nanoc-4.3.4 test/filters/test_pandoc.rb
nanoc-4.3.3 test/filters/test_pandoc.rb
nanoc-4.3.2 test/filters/test_pandoc.rb
nanoc-4.3.1 test/filters/test_pandoc.rb
nanoc-4.3.0 test/filters/test_pandoc.rb
nanoc-4.2.4 test/filters/test_pandoc.rb
nanoc-4.2.3 test/filters/test_pandoc.rb
nanoc-4.2.2 test/filters/test_pandoc.rb
nanoc-4.2.1 test/filters/test_pandoc.rb
nanoc-4.2.0 test/filters/test_pandoc.rb