test/markup_test.rb (view raw)
1$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
2$LOAD_PATH.unshift File.dirname(__FILE__)
3
4require 'github/markup'
5require 'test/unit'
6require 'helper'
7
8class MarkupTest < Test::Unit::TestCase
9 extend MarkupTestDSL
10
11 def test_graceful_fail
12 content = "* One\n* Two"
13 text = GitHub::Markup.render('README.imadeitup', content)
14 assert_equal content, text
15 end
16
17 test 'README.markdown', <<-input, <<-output
18* One
19* Two
20input
21<ul>
22<li>One</li>
23<li>Two</li>
24</ul>\n
25output
26
27 test 'README.textile', <<-input, <<-output.strip
28* One
29* Two
30input
31<ul>
32\t<li>One</li>
33\t<li>Two</li>
34</ul>\n
35output
36
37 test 'README.txt', <<-input, <<-output
38* One
39* Two
40input
41* One
42* Two
43output
44
45 test 'README.rst', <<-input, <<-output
461. Blah blah ``code`` blah
47
482. More ``code``, hooray
49input
50<div class="document">
51<ol class="arabic simple">
52<li>Blah blah <tt class="docutils literal">code</tt> blah</li>
53<li>More <tt class="docutils literal">code</tt>, hooray</li>
54</ol>
55</div>\n
56output
57end