summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-23 02:32:20 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-23 02:32:20 +0000
commit400afca88a0adb5a380925dea61220e08a04022f (patch)
tree8820f8f9892d6dc75e4dd0f3110cd91844f15736 /test/rdoc
parent30014a61567b1b672ae46ecf5ff27c059f6c4eea (diff)
Update to RDoc 2.5.6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_code_object.rb12
-rw-r--r--test/rdoc/test_rdoc_options.rb11
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb11
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb7
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb9
5 files changed, 48 insertions, 2 deletions
diff --git a/test/rdoc/test_rdoc_code_object.rb b/test/rdoc/test_rdoc_code_object.rb
index 7e6098460f..907bb7a3d5 100644
--- a/test/rdoc/test_rdoc_code_object.rb
+++ b/test/rdoc/test_rdoc_code_object.rb
@@ -61,6 +61,18 @@ class TestRDocCodeObject < XrefTestCase
assert @co.documented?
end
+ def test_metadata
+ assert_empty @co.metadata
+
+ @co.metadata['markup'] = 'not_rdoc'
+
+ expected = { 'markup' => 'not_rdoc' }
+
+ assert_equal expected, @co.metadata
+
+ assert_equal 'not_rdoc', @co.metadata['markup']
+ end
+
def test_parent_file_name
assert_equal '(unknown)', @co.parent_file_name
assert_equal 'xref_data.rb', @c1.parent_file_name
diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb
index a3b1876bf3..62a5b2db54 100644
--- a/test/rdoc/test_rdoc_options.rb
+++ b/test/rdoc/test_rdoc_options.rb
@@ -39,5 +39,16 @@ class TestRDocOptions < MiniTest::Unit::TestCase
assert_match %r%^invalid option: --bogus%, err
end
+ def test_parse_main
+ out, err = capture_io do
+ @options.parse %w[--main MAIN]
+ end
+
+ assert_empty out
+ assert_empty err
+
+ assert_equal 'MAIN', @options.main_page
+ end
+
end
diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb
index 38fb908492..4f5d9e3171 100644
--- a/test/rdoc/test_rdoc_parser_c.rb
+++ b/test/rdoc/test_rdoc_parser_c.rb
@@ -406,6 +406,17 @@ Init_Foo(void) {
assert_equal "a comment for bar", bar.comment
end
+ def test_look_for_directives_in
+ parser = util_parser ''
+
+ comment = "# :markup: not_rdoc\n"
+
+ parser.look_for_directives_in @top_level, comment
+
+ assert_equal "# :markup: not_rdoc\n", comment
+ assert_equal 'not_rdoc', @top_level.metadata['markup']
+ end
+
def test_define_method
content = <<-EOF
/*Method Comment! */
diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb
index d9a7a4f3d5..f4bd50ba16 100644
--- a/test/rdoc/test_rdoc_parser_ruby.rb
+++ b/test/rdoc/test_rdoc_parser_ruby.rb
@@ -151,11 +151,14 @@ class TestRDocParserRuby < MiniTest::Unit::TestCase
def test_look_for_directives_in_unhandled
util_parser ""
- comment = "# :unhandled: \n# :title: hi\n"
+ comment = "# :unhandled: \n# :markup: not rdoc\n# :title: hi\n"
@parser.look_for_directives_in @top_level, comment
- assert_equal "# :unhandled: \n", comment
+ assert_equal "# :unhandled: \n# :markup: not rdoc\n", comment
+
+ assert_equal nil, @top_level.metadata['unhandled']
+ assert_equal 'not rdoc', @top_level.metadata['markup']
assert_equal 'hi', @options.title
end
diff --git a/test/rdoc/test_rdoc_parser_simple.rb b/test/rdoc/test_rdoc_parser_simple.rb
index 6edb51481a..a83f105edd 100644
--- a/test/rdoc/test_rdoc_parser_simple.rb
+++ b/test/rdoc/test_rdoc_parser_simple.rb
@@ -22,6 +22,15 @@ class TestRDocParserSimple < MiniTest::Unit::TestCase
@tempfile.close
end
+ def test_initialize_metadata
+ parser = util_parser ":unhandled: \n# :markup: not rdoc\n"
+
+ assert_equal nil, @top_level.metadata['unhandled']
+ assert_equal 'not rdoc', @top_level.metadata['markup']
+
+ assert_equal ":unhandled: \n# :markup: not rdoc\n", parser.content
+ end
+
def test_remove_coding_comment
parser = util_parser <<-TEXT
# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-