2008-10-24 19:05:28 -04:00
|
|
|
require 'rubygems'
|
2010-04-01 03:45:16 -04:00
|
|
|
require 'minitest/autorun'
|
2008-01-18 19:06:19 -05:00
|
|
|
require 'rdoc/markup'
|
|
|
|
require 'rdoc/markup/to_test'
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-10-24 19:05:28 -04:00
|
|
|
class TestRDocMarkup < MiniTest::Unit::TestCase
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
def test_convert
|
|
|
|
str = <<-STR
|
|
|
|
now is
|
|
|
|
the time
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
hello
|
|
|
|
dave
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
1. l1
|
|
|
|
2. l2
|
|
|
|
STR
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-02-09 22:59:08 -05:00
|
|
|
m = RDoc::Markup.new
|
2010-04-01 03:45:16 -04:00
|
|
|
out = m.convert str, RDoc::Markup::ToTest.new
|
|
|
|
|
|
|
|
expected = [
|
|
|
|
"now is the time",
|
|
|
|
"\n",
|
|
|
|
" hello\n dave\n",
|
|
|
|
"1: ",
|
|
|
|
"l1",
|
|
|
|
"1: ",
|
|
|
|
"l2",
|
2008-02-09 22:59:08 -05:00
|
|
|
]
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
assert_equal expected, out
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2007-12-28 01:13:06 -05:00
|
|
|
|