Sha256: ac4c0ab4d2228f74259bff1e0118fc70f850806654d249204ecac72db35b5163

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

# coding: UTF-8
require 'test_helper'

class StripDownRender < Greenmat::TestCase
  def setup
    @parser = Greenmat::Markdown.new(Greenmat::Render::StripDown)
  end

  def test_titles
    markdown = "# Foo bar"
    output   = @parser.render(markdown)

    assert_equal "Foo bar\n", output
  end

  def test_code_blocks
    markdown = "\tclass Foo\n\tend"
    output   = @parser.render(markdown)

    assert_equal "class Foo\nend\n", output
  end

  def test_images
    markdown = "Look at this ![picture](http://example.org/picture.png)\n" \
               "And this: ![](http://example.org/image.jpg)"
    expected = "Look at this picture http://example.org/picture.png\n" \
               "And this: http://example.org/image.jpg\n"
    output   = @parser.render(markdown)

    assert_equal expected, output
  end

  def test_links
    markdown = "Here's an [example](https://github.com)"
    expected = "Here's an example (https://github.com)\n"
    output   = @parser.render(markdown)

    assert_equal expected, output
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
greenmat-3.2.2.4 test/stripdown_render_test.rb
greenmat-3.2.2.3 test/stripdown_render_test.rb
greenmat-3.2.2.2 test/stripdown_render_test.rb
greenmat-3.2.2.1 test/stripdown_render_test.rb
greenmat-3.2.2.0 test/stripdown_render_test.rb
greenmat-3.2.0.2 test/stripdown_render_test.rb
greenmat-3.2.0.1 test/stripdown_render_test.rb
greenmat-3.2.0.0 test/stripdown_render_test.rb