Skip to content

Ignore locale at write_options #1079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/rdoc/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class RDoc::Options
generator_name
generator_options
generators
locale
op_dir
page_dir
option_parser
Expand Down
23 changes: 22 additions & 1 deletion test/rdoc/test_rdoc_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def test_to_yaml
'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,
Expand Down Expand Up @@ -902,6 +901,28 @@ def test_no_skip_test_value
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)
Expand Down