Sha256: 284afb581c4c182faeb5a17d8479c91374aff03098fa670699dcd54c9cd805f4

Contents?: true

Size: 800 Bytes

Versions: 14

Compression:

Stored size: 800 Bytes

Contents

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-4.1.1 test/filters/test_redcloth.rb
nanoc-4.1.0 test/filters/test_redcloth.rb
nanoc-4.1.0rc2 test/filters/test_redcloth.rb
nanoc-4.1.0rc1 test/filters/test_redcloth.rb
nanoc-4.1.0b1 test/filters/test_redcloth.rb
nanoc-4.1.0a1 test/filters/test_redcloth.rb
nanoc-4.0.2 test/filters/test_redcloth.rb
nanoc-4.0.1 test/filters/test_redcloth.rb
nanoc-4.0.0 test/filters/test_redcloth.rb
nanoc-4.0.0rc3 test/filters/test_redcloth.rb
nanoc-4.0.0rc2 test/filters/test_redcloth.rb
nanoc-4.0.0rc1 test/filters/test_redcloth.rb
nanoc-4.0.0b4 test/filters/test_redcloth.rb
nanoc-4.0.0b3 test/filters/test_redcloth.rb