summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_top_level.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_top_level.rb')
-rw-r--r--test/rdoc/test_rdoc_top_level.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_top_level.rb b/test/rdoc/test_rdoc_top_level.rb
index 61f4362d09..9c7a3db66f 100644
--- a/test/rdoc/test_rdoc_top_level.rb
+++ b/test/rdoc/test_rdoc_top_level.rb
@@ -9,6 +9,20 @@ class TestRDocTopLevel < XrefTestCase
@top_level.parser = RDoc::Parser::Ruby
end
+ def test_initialize
+ t = RDoc::TopLevel.new 'path/file.rb'
+
+ assert_equal 'path/file.rb', t.absolute_name
+ assert_equal 'path/file.rb', t.relative_name
+ end
+
+ def test_initialize_relative
+ t = RDoc::TopLevel.new 'path/file.rb', 'file.rb'
+
+ assert_equal 'path/file.rb', t.absolute_name
+ assert_equal 'file.rb', t.relative_name
+ end
+
def test_add_alias
a = RDoc::Alias.new nil, 'old', 'new', nil
@top_level.add_alias a