all repos — markup @ 8a01c90d0c40ca6aae39e7b31f8128b61554913a

The code we use to render README.your_favorite_markup

test/markup_test.rb (view raw)

 1$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
 2
 3require 'github/markup'
 4require 'test/unit'
 5
 6class MarkupTest < Test::Unit::TestCase
 7  def test_markdown
 8    markdown = GitHub::Markup.render('README.markdown', "* One\n* Two")
 9    assert_equal <<markdown, markdown
10<ul>
11<li>One</li>
12<li>Two</li>
13</ul>
14
15markdown
16  end
17
18  def test_textile
19    textile = GitHub::Markup.render('README.textile', "* One\n* Two")
20    assert_equal <<textile.strip, textile
21<ul>
22\t<li>One</li>
23\t<li>Two</li>
24</ul>
25textile
26  end
27
28  def test_graceful_fail
29    content = "* One\n* Two"
30    text = GitHub::Markup.render('README.imadeitup', content)
31    assert_equal content, text
32  end
33end