diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 8351bf8ffe..c2b9afa7a7 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -442,7 +442,7 @@ def remove_unparseable files def document options if RDoc::Options === options then - @options = options + @options = options.parse [] # Some logic only lives in `parse` method such as default generator else @options = RDoc::Options.load_options @options.parse options diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb index 050f92274f..f15b2b2125 100644 --- a/test/rdoc/test_rdoc_rdoc.rb +++ b/test/rdoc/test_rdoc_rdoc.rb @@ -14,6 +14,17 @@ def setup @rdoc.instance_variable_set :@stats, @stats end + def test_document_with_bare_options + rdoc = RDoc::RDoc.new + options = RDoc::Options.new + temp_dir do + rdoc.document options + end + store = rdoc.store + assert_equal nil, store.main + assert_equal nil, store.title + end + def test_document # functional test options = RDoc::Options.new options.files = [File.expand_path('../xref_data.rb', __FILE__)]