Sha256: a11b1a9a315b4d859ab5ecc7d63ff3edbdc847bd754047ea8ab3c87e5b29a92e

Contents?: true

Size: 1.65 KB

Versions: 17

Compression:

Stored size: 1.65 KB

Contents

# coding: UTF-8
require 'test_helper'

class StripDownRender < Redcarpet::TestCase
  def setup
    @renderer = Redcarpet::Render::StripDown
  end

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

    assert_equal "Foo bar", output
  end

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

    assert_equal "class Foo\nend", 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"
    output   = 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)"
    output   = render(markdown)

    assert_equal expected, output
  end

  def test_tables
    markdown = "| Left-Aligned  | Centre Aligned  | Right Aligned |\n" \
               "| :------------ |:---------------:| -----:|\n" \
               "| col 3 is      | some wordy text | $1600 |\n" \
               "| col 2 is      | centered        |   $12 |"
    expected = "Left-Aligned\tCentre Aligned\tRight Aligned\t\n" \
               "col 3 is\tsome wordy text\t$1600\t\n" \
               "col 2 is\tcentered\t$12\t"
    output   = render(markdown, with: [:tables])

    assert_equal expected, output
  end

  def test_highlight
    markdown = "==Hello world!=="
    expected = "Hello world!"
    output   = render(markdown, with: [:highlight])

    assert_equal expected, output
  end
end

Version data entries

17 entries across 13 versions & 5 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.13 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.12.1 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.11 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.9 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.8 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.7 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.6 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.5 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
tdiary-5.0.4 vendor/bundle/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/redcarpet-3.4.0/test/stripdown_render_test.rb
redcarpet-3.4.0 test/stripdown_render_test.rb