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.rdoc', <<-input, <<-output
46* One
47* Two
48input
49<ul>
50<li>One\n\n</li>
51<li>Two\n\n</li>
52</ul>
53output
54
55 test 'README.rst', <<-input, <<-output
561. Blah blah ``code`` blah
57
582. More ``code``, hooray
59input
60<div class="document">
61<ol class="arabic simple">
62<li>Blah blah <tt class="docutils literal">code</tt> blah</li>
63<li>More <tt class="docutils literal">code</tt>, hooray</li>
64</ol>
65</div>\n
66output
67end