mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add link to Ruby options doc in help text
Adds link to https://docs.ruby-lang.org/en/master/ruby/options_md.html in Ruby help text (-h and --help).
This commit is contained in:
parent
7595ac9a9e
commit
31ff07ed1e
4 changed files with 23 additions and 4 deletions
|
@ -49,18 +49,24 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
|
||||
def test_usage
|
||||
assert_in_out_err(%w(-h)) do |r, e|
|
||||
assert_operator(r.size, :<=, 25)
|
||||
longer = r[1..-1].select {|x| x.size >= 80}
|
||||
assert_operator(r.size, :<=, 26)
|
||||
longer = r[3..-1].select {|x| x.size >= 80}
|
||||
assert_equal([], longer)
|
||||
assert_equal([], e)
|
||||
|
||||
version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
|
||||
assert_include(r, "Details and examples at https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html")
|
||||
end
|
||||
end
|
||||
|
||||
def test_usage_long
|
||||
assert_in_out_err(%w(--help)) do |r, e|
|
||||
longer = r[1..-1].select {|x| x.size > 80}
|
||||
longer = r[3..-1].select {|x| x.size > 80}
|
||||
assert_equal([], longer)
|
||||
assert_equal([], e)
|
||||
|
||||
version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
|
||||
assert_include(r, "Details and examples at https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue