mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
Prepare to release RubyGems 3.1.0 final version.
This commit is contained in:
parent
26774351dc
commit
82cc2843a9
23 changed files with 393 additions and 142 deletions
|
@ -3,6 +3,10 @@ require 'rubygems/test_case'
|
|||
require 'rubygems/indexer'
|
||||
require 'rubygems/commands/generate_index_command'
|
||||
|
||||
unless defined?(Builder::XChar)
|
||||
warn "generate_index tests are being skipped. Install builder gem."
|
||||
end
|
||||
|
||||
class TestGemCommandsGenerateIndexCommand < Gem::TestCase
|
||||
|
||||
def setup
|
||||
|
@ -22,6 +26,18 @@ class TestGemCommandsGenerateIndexCommand < Gem::TestCase
|
|||
assert File.exist?(specs), specs
|
||||
end
|
||||
|
||||
def test_execute_no_modern
|
||||
@cmd.options[:modern] = false
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
specs = File.join @gemhome, "specs.4.8.gz"
|
||||
|
||||
assert File.exist?(specs), specs
|
||||
end
|
||||
|
||||
def test_handle_options_directory
|
||||
return if win_platform?
|
||||
refute_equal '/nonexistent', @cmd.options[:directory]
|
||||
|
@ -47,4 +63,24 @@ class TestGemCommandsGenerateIndexCommand < Gem::TestCase
|
|||
assert @cmd.options[:update]
|
||||
end
|
||||
|
||||
end if ''.respond_to? :to_xs
|
||||
def test_handle_options_modern
|
||||
use_ui @ui do
|
||||
@cmd.handle_options %w[--modern]
|
||||
end
|
||||
|
||||
assert_equal \
|
||||
"WARNING: The \"--modern\" option has been deprecated and will be removed in Rubygems 4.0. Modern indexes (specs, latest_specs, and prerelease_specs) are always generated, so this option is not needed.\n",
|
||||
@ui.error
|
||||
end
|
||||
|
||||
def test_handle_options_no_modern
|
||||
use_ui @ui do
|
||||
@cmd.handle_options %w[--no-modern]
|
||||
end
|
||||
|
||||
assert_equal \
|
||||
"WARNING: The \"--no-modern\" option has been deprecated and will be removed in Rubygems 4.0. The `--no-modern` option is currently ignored. Modern indexes (specs, latest_specs, and prerelease_specs) are always generated.\n",
|
||||
@ui.error
|
||||
end
|
||||
|
||||
end if defined?(Builder::XChar)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue