Sha256: 9f27ba632e3b9afaf679f0d06d0e8c55f8cdd6500a5692c9a46abc0537f8b3d7

Contents?: true

Size: 969 Bytes

Versions: 10

Compression:

Stored size: 969 Bytes

Contents

require ::File.expand_path(
    ::File.join(::File.dirname(__FILE__), %w[.. .. spec_helper]))

# ---------------------------------------------------------------------------
describe 'Webby::Filters::Maruku' do

  it 'should regsiter the maruku filter handler' do
    Webby::Filters._handlers['maruku'].should_not be_nil
  end

  if try_require('maruku')

    it 'processes maruku markup into HTML' do
      input = "## Heading Two\n\nAnd some text about this heading."
      output = Webby::Filters._handlers['maruku'].call(input)

      output.should == %Q{<h2 id='heading_two'>Heading Two</h2>\n\n<p>And some text about this heading.</p>}
    end

  else

    it 'raises an error when maruku is used but not installed' do
      input = "## Heading Two\n\nAnd some text about this heading."
      lambda {Webby::Filters._handlers['maruku'].call(input)}.should raise_error(Webby::Error, "'maruku' must be installed to use the maruku filter")
    end

  end
end

# EOF

Version data entries

10 entries across 10 versions & 8 rubygems

Version Path
TwP-webby-0.9.4.1 spec/webby/filters/maruku_spec.rb
TwP-webby-0.9.4 spec/webby/filters/maruku_spec.rb
blowmage-webby-0.9.4.1 spec/webby/filters/maruku_spec.rb
dysinger-webby-0.9.4 spec/webby/filters/maruku_spec.rb
francois-webby-0.9.4.1 spec/webby/filters/maruku_spec.rb
giraffesoft-webby-0.9.5 spec/webby/filters/maruku_spec.rb
mikker-webby-0.9.4 spec/webby/filters/maruku_spec.rb
jamesgolick-webby-0.9.5 spec/webby/filters/maruku_spec.rb
webby-0.9.4 spec/webby/filters/maruku_spec.rb
webby-0.9.4-x86-mswin32 spec/webby/filters/maruku_spec.rb