Sha256: 573e53e2a37e9d2576a2d1d30ac956b3bd0509ec52e1383c040c9777c3920856

Contents?: true

Size: 824 Bytes

Versions: 14

Compression:

Stored size: 824 Bytes

Contents

# encoding: utf-8

class Nanoc::Filters::RedClothTest < Nanoc::TestCase

  def test_filter
    if_have 'redcloth' do
      # Get filter
      filter = ::Nanoc::Filters::RedCloth.new

      # Run filter
      result = filter.setup_and_run("h1. Foo")
      assert_equal("<h1>Foo</h1>", result)
    end
  end

  def test_filter_with_options
    if_have 'redcloth' do
      # Get filter
      filter = ::Nanoc::Filters::RedCloth.new

      # Run filter without options
      result = filter.setup_and_run("I am a member of SPECTRE.")
      assert_equal("<p>I am a member of <span class=\"caps\">SPECTRE</span>.</p>", result)

      # Run filter with options
      result = filter.setup_and_run("I am a member of SPECTRE.", :no_span_caps => true)
      assert_equal("<p>I am a member of SPECTRE.</p>", result)
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
nanoc-3.7.3 test/filters/test_redcloth.rb
nanoc-3.7.2 test/filters/test_redcloth.rb
nanoc-3.7.1 test/filters/test_redcloth.rb
nanoc-3.7.0 test/filters/test_redcloth.rb
nanoc-3.6.11 test/filters/test_redcloth.rb
nanoc-3.6.10 test/filters/test_redcloth.rb
nanoc-3.6.9 test/filters/test_redcloth.rb
nanoc-3.6.8 test/filters/test_redcloth.rb
nanoc-3.6.7 test/filters/test_redcloth.rb
nanoc-3.6.6 test/filters/test_redcloth.rb
nanoc-3.6.5 test/filters/test_redcloth.rb
nanoc-3.6.4 test/filters/test_redcloth.rb
nanoc-3.6.3 test/filters/test_redcloth.rb
nanoc-3.6.2 test/filters/test_redcloth.rb