Sha256: b3593507f09571b7265bc305b062c32b142515e143d939567ed22e7541432f19

Contents?: true

Size: 847 Bytes

Versions: 18

Compression:

Stored size: 847 Bytes

Contents

# frozen_string_literal: true

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

18 entries across 18 versions & 1 rubygems

Version Path
nanoc-4.8.12 test/filters/test_redcloth.rb
nanoc-4.8.11 test/filters/test_redcloth.rb
nanoc-4.8.10 test/filters/test_redcloth.rb
nanoc-4.8.9 test/filters/test_redcloth.rb
nanoc-4.8.8 test/filters/test_redcloth.rb
nanoc-4.8.7 test/filters/test_redcloth.rb
nanoc-4.8.6 test/filters/test_redcloth.rb
nanoc-4.8.5 test/filters/test_redcloth.rb
nanoc-4.8.4 test/filters/test_redcloth.rb
nanoc-4.8.3 test/filters/test_redcloth.rb
nanoc-4.8.2 test/filters/test_redcloth.rb
nanoc-4.8.1 test/filters/test_redcloth.rb
nanoc-4.8.0 test/filters/test_redcloth.rb
nanoc-4.7.14 test/filters/test_redcloth.rb
nanoc-4.7.13 test/filters/test_redcloth.rb
nanoc-4.7.12 test/filters/test_redcloth.rb
nanoc-4.7.11 test/filters/test_redcloth.rb
nanoc-4.7.10 test/filters/test_redcloth.rb