diff --git a/lib/rdoc/rubygems_hook.rb b/lib/rdoc/rubygems_hook.rb index b209262a4e..9e1a880342 100644 --- a/lib/rdoc/rubygems_hook.rb +++ b/lib/rdoc/rubygems_hook.rb @@ -198,6 +198,7 @@ def generate @rdoc.options = parse_options @rdoc.store = Store.new(parse_options) @rdoc.parse_files parse_options.files + @rdoc.store.complete parse_options.visibility end document 'ri', options, @ri_dir if diff --git a/test/rdoc/rdoc_rubygems_hook_test.rb b/test/rdoc/rdoc_rubygems_hook_test.rb index 54a124d261..26f394e57d 100644 --- a/test/rdoc/rdoc_rubygems_hook_test.rb +++ b/test/rdoc/rdoc_rubygems_hook_test.rb @@ -146,6 +146,25 @@ def test_generate_all assert_equal 'MyTitle', rdoc.store.main end + def test_generate_completes_store + File.write File.join(@a.gem_dir, 'lib', 'a.rb'), <<~RUBY + class A + def public_method; end + + private def private_method; end + end + + class Hidden # :nodoc: + end + RUBY + + @hook.generate + + store = @hook.instance_variable_get(:@rdoc).store + assert_equal %w[public_method], store.find_class_named('A').method_list.map(&:name) + assert_nil store.find_class_named('Hidden') + end + def test_generate_rdoc_with_page_cross_reference @hook.generate_rdoc = true @hook.generate_ri = false