summaryrefslogtreecommitdiff
path: root/jni/ruby/test/rdoc/xref_test_case.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/rdoc/xref_test_case.rb
Fresh start
Diffstat (limited to 'jni/ruby/test/rdoc/xref_test_case.rb')
-rw-r--r--jni/ruby/test/rdoc/xref_test_case.rb67
1 files changed, 67 insertions, 0 deletions
diff --git a/jni/ruby/test/rdoc/xref_test_case.rb b/jni/ruby/test/rdoc/xref_test_case.rb
new file mode 100644
index 0000000..a56fa71
--- /dev/null
+++ b/jni/ruby/test/rdoc/xref_test_case.rb
@@ -0,0 +1,67 @@
+ENV['RDOC_TEST'] = 'yes'
+
+require 'rdoc'
+require File.expand_path '../xref_data', __FILE__
+
+class XrefTestCase < RDoc::TestCase
+
+ def setup
+ super
+
+ @options = RDoc::Options.new
+ @options.quiet = true
+
+ @rdoc.options = @options
+
+ @file_name = 'xref_data.rb'
+ @xref_data = @store.add_file @file_name
+ @top_level = @xref_data
+
+ stats = RDoc::Stats.new @store, 0
+
+ parser = RDoc::Parser::Ruby.new @xref_data, @file_name, XREF_DATA, @options,
+ stats
+ @top_levels = []
+ @top_levels.push parser.scan
+
+ generator = Object.new
+ def generator.class_dir() nil end
+ def generator.file_dir() nil end
+ @rdoc.options = @options
+ @rdoc.generator = generator
+
+ @c1 = @xref_data.find_module_named 'C1'
+ @c1_m = @c1.method_list.last # C1#m
+ @c1__m = @c1.method_list.first # C1::m
+
+ @c2 = @xref_data.find_module_named 'C2'
+ @c2_a = @c2.method_list.last
+ @c2_b = @c2.method_list.first
+
+ @c2_c3 = @xref_data.find_module_named 'C2::C3'
+ @c2_c3_m = @c2_c3.method_list.first # C2::C3#m
+
+ @c2_c3_h1 = @xref_data.find_module_named 'C2::C3::H1'
+ @c2_c3_h1_meh = @c2_c3_h1.method_list.first # C2::C3::H1#m?
+
+ @c3 = @xref_data.find_module_named 'C3'
+ @c4 = @xref_data.find_module_named 'C4'
+ @c4_c4 = @xref_data.find_module_named 'C4::C4'
+ @c5_c1 = @xref_data.find_module_named 'C5::C1'
+ @c3_h1 = @xref_data.find_module_named 'C3::H1'
+ @c3_h2 = @xref_data.find_module_named 'C3::H2'
+
+ @m1 = @xref_data.find_module_named 'M1'
+ @m1_m = @m1.method_list.first
+
+ @m1_m2 = @xref_data.find_module_named 'M1::M2'
+
+ @parent = @xref_data.find_module_named 'Parent'
+ @child = @xref_data.find_module_named 'Child'
+
+ @parent_m = @parent.method_list.first # Parent#m
+ @parent__m = @parent.method_list.last # Parent::m
+ end
+
+end
+