зеркало из https://github.com/github/ruby.git
[ruby/rdoc] Ignore `locale` at `write_options`
`@locale` is set from `@locale_name` and loaded from `@locale_dir` after `write_options`, and `RDoc::I18n::Locale` does not seem to expected to be loaded. https://github.com/ruby/rdoc/commit/fd610f7023
This commit is contained in:
Родитель
913b26d0fd
Коммит
f6847e9456
|
@ -105,6 +105,7 @@ class RDoc::Options
|
|||
generator_name
|
||||
generator_options
|
||||
generators
|
||||
locale
|
||||
op_dir
|
||||
page_dir
|
||||
option_parser
|
||||
|
|
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче