1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/rdoc] Allow empty .rdoc_options

https://github.com/ruby/rdoc/commit/0c8cb25b50
This commit is contained in:
aycabta 2021-03-08 06:14:03 +09:00 committed by Nobuyoshi Nakada
parent 971a0cd246
commit 61a29a41e1
Notes: git 2021-03-16 15:47:52 +09:00
2 changed files with 13 additions and 0 deletions

View file

@ -166,6 +166,8 @@ class RDoc::RDoc
rescue Psych::SyntaxError
end
return RDoc::Options.new if options == false # Allow empty file.
raise RDoc::Error, "#{options_file} is not a valid rdoc options file" unless
RDoc::Options === options or Hash === options

View file

@ -133,6 +133,17 @@ class TestRDocRDoc < RDoc::TestCase
end
end
def test_load_options_empty_file
temp_dir do
File.open '.rdoc_options', 'w' do |io|
end
options = @rdoc.load_options
assert_equal 'rdoc', options.markup
end
end
def test_load_options_partial_override
temp_dir do
File.open '.rdoc_options', 'w' do |io|