Sha256: 9b8d9c753d5e3d013ada98672999c93f380d331971dadd50373816c41db22544

Contents?: true

Size: 819 Bytes

Versions: 6

Compression:

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

6 entries across 6 versions & 1 rubygems

Version Path
nanoc-4.0.0b2 test/filters/test_redcloth.rb
nanoc-4.0.0b1 test/filters/test_redcloth.rb
nanoc-4.0.0a2 test/filters/test_redcloth.rb
nanoc-4.0.0a1 test/filters/test_redcloth.rb
nanoc-3.8.0 test/filters/test_redcloth.rb
nanoc-3.7.5 test/filters/test_redcloth.rb