diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 6ee29fd071..7518e6cc54 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -105,6 +105,7 @@ class RDoc::Options generator_name generator_options generators + locale op_dir page_dir option_parser diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb index 443d595ca6..92cc678213 100644 --- a/test/rdoc/test_rdoc_options.rb +++ b/test/rdoc/test_rdoc_options.rb @@ -68,7 +68,6 @@ class TestRDocOptions < RDoc::TestCase 'exclude' => %w[~\z \.orig\z \.rej\z \.bak\z \.gemspec\z], 'hyperlink_all' => false, 'line_numbers' => false, - 'locale' => nil, 'locale_dir' => 'locale', 'locale_name' => nil, 'main_page' => nil, @@ -902,6 +901,28 @@ rdoc_include: assert_equal false, @options.skip_tests end + def test_locale_name_default + temp_dir do + @options.parse %w[] + assert_equal 'locale', @options.instance_variable_get(:@locale_dir) + assert_nil @options.instance_variable_get(:@locale_name) + assert_nil @options.locale + @options.finish + assert_nil @options.locale + end + end + + def test_locale_name + temp_dir do + @options.parse %w[--locale fr] + assert_equal 'locale', @options.instance_variable_get(:@locale_dir) + assert_equal 'fr', @options.instance_variable_get(:@locale_name) + assert_nil @options.locale + @options.finish + assert_equal 'fr', @options.locale.name + end + end + class DummyCoder < Hash alias add :[]= def tag=(tag)