Sha256: 9b82db975bc5f6c1e21090efedcea289992e5a6c5d1a0ec12cade3ab1b7bd0c3
Contents?: true
Size: 1.66 KB
Versions: 2
Compression:
Stored size: 1.66 KB
Contents
# encoding: utf-8 class Nanoc3::Filters::RedcarpetTest < MiniTest::Unit::TestCase include Nanoc3::TestHelpers def test_find refute Nanoc3::Filter.named(:redcarpet).nil? end def test_filter if_have 'redcarpet' do # Create filter filter = ::Nanoc3::Filters::Redcarpet.new # Run filter result = filter.run("> Quote") assert_match(/<blockquote>\s*<p>Quote<\/p>\s*<\/blockquote>/, result) end end def test_with_extensions if_have 'redcarpet' do # Create filter filter = ::Nanoc3::Filters::Redcarpet.new # Run filter input = "The quotation 'marks' sure make this look sarcastic!" output_expected = /The quotation ‘marks’ sure make this look sarcastic!/ output_actual = filter.run(input, :options => [ :smart ]) assert_match(output_expected, output_actual) end end def test_html_by_default if_have 'redcarpet' do # Create filter filter = ::Nanoc3::Filters::Redcarpet.new # Run filter input = "![Alt](/path/to/img 'Title')" output_expected = %r{<img src="/path/to/img" alt="Alt" title="Title">} output_actual = filter.run(input) assert_match(output_expected, output_actual) end end def test_xhtml_if_requested if_have 'redcarpet' do # Create filter filter = ::Nanoc3::Filters::Redcarpet.new # Run filter input = "![Alt](/path/to/img 'Title')" output_expected = %r{<img src="/path/to/img" alt="Alt" title="Title"/>} output_actual = filter.run(input, :options => [ :xhtml ]) assert_match(output_expected, output_actual) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nanoc3-3.2.0b2 | test/filters/test_redcarpet.rb |
nanoc3-3.2.0b1 | test/filters/test_redcarpet.rb |