From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/ruby/test/rdoc/test_rdoc_normal_module.rb | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 jni/ruby/test/rdoc/test_rdoc_normal_module.rb (limited to 'jni/ruby/test/rdoc/test_rdoc_normal_module.rb') diff --git a/jni/ruby/test/rdoc/test_rdoc_normal_module.rb b/jni/ruby/test/rdoc/test_rdoc_normal_module.rb new file mode 100644 index 0000000..1944564 --- /dev/null +++ b/jni/ruby/test/rdoc/test_rdoc_normal_module.rb @@ -0,0 +1,42 @@ +require File.expand_path '../xref_test_case', __FILE__ + +class TestRDocNormalModule < XrefTestCase + + def setup + super + + @mod = RDoc::NormalModule.new 'Mod' + end + + def test_ancestors_module + top_level = @store.add_file 'file.rb' + mod = top_level.add_module RDoc::NormalModule, 'Mod' + incl = RDoc::Include.new 'Incl', '' + + mod.add_include incl + + assert_equal [incl.name], mod.ancestors + + mod2 = top_level.add_module RDoc::NormalModule, 'Inc2' + inc2 = RDoc::Include.new 'Inc2', '' + mod.add_include inc2 + assert_equal [mod2, incl.name], mod.ancestors + end + + def test_aref + assert_equal 'module-M1', @m1.aref + assert_equal 'module-M1::M2', @m1_m2.aref + end + + def test_definition + m = RDoc::NormalModule.new 'M' + + assert_equal 'module M', m.definition + end + + def test_module_eh + assert @mod.module? + end + +end + -- cgit v1.2.3