Sha256: c31a73edbaef0fd4b338cee9009a5d2257f234b1334f85b51fab546bf46da250

Contents?: true

Size: 837 Bytes

Versions: 8

Compression:

Stored size: 837 Bytes

Contents

# encoding: utf-8

class Nanoc3::Filters::RedClothTest < MiniTest::Unit::TestCase

  include Nanoc3::TestHelpers

  def test_filter
    if_have 'redcloth' do
      # Get filter
      filter = ::Nanoc3::Filters::RedCloth.new

      # Run filter
      result = filter.run("h1. Foo")
      assert_equal("<h1>Foo</h1>", result)
    end
  end

  def test_filter_with_options
    if_have 'redcloth' do
      # Get filter
      filter = ::Nanoc3::Filters::RedCloth.new

      # Run filter without options
      result = filter.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.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

8 entries across 8 versions & 1 rubygems

Version Path
nanoc3-3.2.4 test/filters/test_redcloth.rb
nanoc3-3.2.3 test/filters/test_redcloth.rb
nanoc3-3.2.2 test/filters/test_redcloth.rb
nanoc3-3.2.1 test/filters/test_redcloth.rb
nanoc3-3.2.0 test/filters/test_redcloth.rb
nanoc3-3.2.0b3 test/filters/test_redcloth.rb
nanoc3-3.2.0b2 test/filters/test_redcloth.rb
nanoc3-3.2.0b1 test/filters/test_redcloth.rb