Sha256: 72683b9a5275f6e5aa0e6dd8563f13278b5033a08c65e74de940dd9c176d4b47

Contents?: true

Size: 816 Bytes

Versions: 22

Compression:

Stored size: 816 Bytes

Contents

require 'helper'

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

22 entries across 22 versions & 1 rubygems

Version Path
nanoc-4.7.9 test/filters/test_redcloth.rb
nanoc-4.7.8 test/filters/test_redcloth.rb
nanoc-4.7.7 test/filters/test_redcloth.rb
nanoc-4.7.6 test/filters/test_redcloth.rb
nanoc-4.7.5 test/filters/test_redcloth.rb
nanoc-4.7.4 test/filters/test_redcloth.rb
nanoc-4.7.3 test/filters/test_redcloth.rb
nanoc-4.7.2 test/filters/test_redcloth.rb
nanoc-4.7.1 test/filters/test_redcloth.rb
nanoc-4.7.0 test/filters/test_redcloth.rb
nanoc-4.6.4 test/filters/test_redcloth.rb
nanoc-4.6.3 test/filters/test_redcloth.rb
nanoc-4.6.2 test/filters/test_redcloth.rb
nanoc-4.6.1 test/filters/test_redcloth.rb
nanoc-4.6.0 test/filters/test_redcloth.rb
nanoc-4.5.4 test/filters/test_redcloth.rb
nanoc-4.5.3 test/filters/test_redcloth.rb
nanoc-4.5.2 test/filters/test_redcloth.rb
nanoc-4.5.1 test/filters/test_redcloth.rb
nanoc-4.5.0 test/filters/test_redcloth.rb