aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_markup.rb31
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb6
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb4
3 files changed, 39 insertions, 2 deletions
diff --git a/test/rdoc/test_rdoc_markup.rb b/test/rdoc/test_rdoc_markup.rb
index 48683dbcda..ae6c11e7da 100644
--- a/test/rdoc/test_rdoc_markup.rb
+++ b/test/rdoc/test_rdoc_markup.rb
@@ -56,5 +56,36 @@ the time
assert_equal expected, out
end
+ def test_convert_document
+ doc = RDoc::Markup::Parser.parse <<-STR
+now is
+the time
+
+ hello
+ dave
+
+1. l1
+2. l2
+ STR
+
+ m = RDoc::Markup.new
+
+ tt = RDoc::Markup::ToTest.new m
+
+ out = m.convert doc, tt
+
+ expected = [
+ "now is the time",
+ "\n",
+ " hello\n dave\n",
+ "1: ",
+ "l1",
+ "1: ",
+ "l2",
+ ]
+
+ assert_equal expected, out
+ end
+
end
diff --git a/test/rdoc/test_rdoc_markup_document.rb b/test/rdoc/test_rdoc_markup_document.rb
index 70fb3efb16..6b4b5892ab 100644
--- a/test/rdoc/test_rdoc_markup_document.rb
+++ b/test/rdoc/test_rdoc_markup_document.rb
@@ -55,6 +55,12 @@ class TestRDocMarkupDocument < MiniTest::Unit::TestCase
refute_empty @d
end
+ def test_empty_eh_document
+ d = @RM::Document.new @d
+
+ assert_empty d
+ end
+
def test_equals2
d2 = @RM::Document.new
diff --git a/test/rdoc/test_rdoc_markup_pre_process.rb b/test/rdoc/test_rdoc_markup_pre_process.rb
index db5fca5ac1..587a680f28 100644
--- a/test/rdoc/test_rdoc_markup_pre_process.rb
+++ b/test/rdoc/test_rdoc_markup_pre_process.rb
@@ -43,7 +43,7 @@ contents of a string.
# FIXME 1.9 fix on windoze
# preprocessor uses binread, so line endings are \r\n
expected.gsub!("\n", "\r\n") if
- RUBY_VERSION =~ /^1.9/ && RUBY_PLATFORM =~ /mswin|mingw/
+ RUBY_VERSION < "1.9.3" && RUBY_PLATFORM =~ /mswin|mingw/
assert_equal expected, content
end
@@ -67,7 +67,7 @@ contents of a string.
# FIXME 1.9 fix on windoze
# preprocessor uses binread, so line endings are \r\n
expected.gsub!("\n", "\r\n") if
- RUBY_VERSION =~ /^1.9/ && RUBY_PLATFORM =~ /mswin|mingw/
+ RUBY_VERSION < "1.9.3" && RUBY_PLATFORM =~ /mswin|mingw/
assert_equal expected, content
end