Sha256: 01d8c0c7911f80ce90cba5b922d620443c3cc23cff206fc8e50812375f919658

Contents?: true

Size: 798 Bytes

Versions: 26

Compression:

Stored size: 798 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

26 entries across 26 versions & 1 rubygems

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