Sha256: bb0207a5415cb1ee7aa8244b47d859240ac1a6a8fe7e3aec778726ad76f3b2d6

Contents?: true

Size: 992 Bytes

Versions: 4

Compression:

Stored size: 992 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

4 entries across 4 versions & 1 rubygems

Version Path
zen-0.4.3 spec/zen/markup.rb
zen-0.4.2 spec/zen/markup.rb
zen-0.4.1 spec/zen/markup.rb
zen-0.4 spec/zen/markup.rb