Sha256: 2c35776b78710d7f1fb534fd711d83c49a7387682d9f4326ff700791010098ca

Contents?: true

Size: 998 Bytes

Versions: 3

Compression:

Stored size: 998 Bytes

Contents

require File.expand_path('../../helper', __FILE__)

describe('Zen::Markup') do
  WebMock.allow_net_connect!

  it('Convert Markdown to HTML') do
    html = Zen::Markup.convert(:markdown, 'hello **world**').strip

    html.should == '<p>hello <strong>world</strong></p>'
  end

  it('Convert Textile to HTML') do
    html = Zen::Markup.convert(:textile, 'hello *world*').strip

    html.should == '<p>hello <strong>world</strong></p>'
  end

  it('Convert HTML to plain text') do
    text = Zen::Markup.convert(:plain, '<p>hello world</p>').strip

    text.should == '&lt;p&gt;hello world&lt;&#x2F;p&gt;'
  end

  it('Convert to HTML to HTML') do
    html = Zen::Markup.convert(:html, '<p>hello world</p>')

    html.should == '<p>hello world</p>'
  end

  it('Specify a non existing engine') do
    begin
      Zen::Markup.convert(:foobar, 'hello')
    rescue ArgumentError => e
      e.message.should == 'The specified engine "foobar" is invalid'
    end
  end

  WebMock.disable_net_connect!
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zen-0.3 spec/zen/markup.rb
zen-0.3b1 spec/zen/markup.rb
zen-0.3b spec/zen/markup.rb