rubygems-update 3.2.17 → 3.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/Manifest.txt +3 -0
- data/Rakefile +6 -6
- data/bundler/CHANGELOG.md +54 -0
- data/bundler/bundler.gemspec +2 -3
- data/bundler/lib/bundler.rb +2 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +13 -33
- data/bundler/lib/bundler/cli/check.rb +4 -2
- data/bundler/lib/bundler/cli/install.rb +6 -7
- data/bundler/lib/bundler/cli/outdated.rb +9 -10
- data/bundler/lib/bundler/definition.rb +29 -82
- data/bundler/lib/bundler/feature_flag.rb +0 -2
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher/index.rb +0 -1
- data/bundler/lib/bundler/friendly_errors.rb +2 -4
- data/bundler/lib/bundler/index.rb +1 -2
- data/bundler/lib/bundler/installer.rb +1 -8
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -7
- data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -8
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +14 -0
- data/bundler/lib/bundler/resolver.rb +15 -96
- data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
- data/bundler/lib/bundler/rubygems_ext.rb +2 -2
- data/bundler/lib/bundler/rubygems_integration.rb +4 -3
- data/bundler/lib/bundler/settings.rb +21 -3
- data/bundler/lib/bundler/source.rb +11 -0
- data/bundler/lib/bundler/source/rubygems.rb +24 -11
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
- data/bundler/lib/bundler/source_list.rb +35 -10
- data/bundler/lib/bundler/source_map.rb +58 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/command.rb +2 -0
- data/lib/rubygems/commands/build_command.rb +1 -1
- data/lib/rubygems/config_file.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
- data/lib/rubygems/installer.rb +4 -0
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/specification.rb +0 -2
- data/lib/rubygems/specification_policy.rb +5 -4
- data/lib/rubygems/test_case.rb +106 -18
- data/lib/rubygems/util/licenses.rb +107 -2
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -2
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/test_bundled_ca.rb +2 -2
- data/test/rubygems/test_deprecate.rb +3 -3
- data/test/rubygems/test_gem.rb +33 -31
- data/test/rubygems/test_gem_bundler_version_finder.rb +3 -5
- data/test/rubygems/test_gem_command.rb +13 -1
- data/test/rubygems/test_gem_command_manager.rb +5 -5
- data/test/rubygems/test_gem_commands_build_command.rb +10 -10
- data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
- data/test/rubygems/test_gem_commands_check_command.rb +5 -5
- data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
- data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
- data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
- data/test/rubygems/test_gem_commands_help_command.rb +8 -1
- data/test/rubygems/test_gem_commands_install_command.rb +60 -60
- data/test/rubygems/test_gem_commands_list_command.rb +1 -1
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +8 -9
- data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
- data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
- data/test/rubygems/test_gem_commands_push_command.rb +6 -11
- data/test/rubygems/test_gem_commands_query_command.rb +7 -7
- data/test/rubygems/test_gem_commands_server_command.rb +2 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
- data/test/rubygems/test_gem_commands_signin_command.rb +13 -6
- data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
- data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
- data/test/rubygems/test_gem_commands_update_command.rb +10 -10
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +9 -9
- data/test/rubygems/test_gem_dependency.rb +12 -6
- data/test/rubygems/test_gem_dependency_installer.rb +4 -4
- data/test/rubygems/test_gem_doctor.rb +30 -30
- data/test/rubygems/test_gem_ext_builder.rb +20 -20
- data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -14
- data/test/rubygems/test_gem_install_update_options.rb +9 -9
- data/test/rubygems/test_gem_installer.rb +162 -140
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_package.rb +48 -48
- data/test/rubygems/test_gem_package_old.rb +9 -9
- data/test/rubygems/test_gem_package_tar_header.rb +5 -5
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
- data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +1 -1
- data/test/rubygems/test_gem_rdoc.rb +9 -9
- data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
- data/test/rubygems/test_gem_request_set.rb +15 -14
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
- data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
- data/test/rubygems/test_gem_requirement.rb +13 -13
- data/test/rubygems/test_gem_resolver.rb +11 -11
- data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
- data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
- data/test/rubygems/test_gem_security.rb +5 -5
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +7 -7
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
- data/test/rubygems/test_gem_server.rb +2 -2
- data/test/rubygems/test_gem_silent_ui.rb +9 -9
- data/test/rubygems/test_gem_source.rb +2 -2
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
- data/test/rubygems/test_gem_source_git.rb +11 -11
- data/test/rubygems/test_gem_source_specific_file.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +86 -106
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_stub_specification.rb +4 -4
- data/test/rubygems/test_gem_uninstaller.rb +16 -16
- data/test/rubygems/test_gem_util.rb +8 -6
- data/test/rubygems/test_gem_version.rb +4 -13
- data/test/rubygems/test_kernel.rb +6 -4
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +12 -14
- data/test/test_changelog_generator.rb +1 -2
- metadata +6 -3
data/rubygems-update.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rubygems-update"
|
5
|
-
s.version = "3.2.
|
5
|
+
s.version = "3.2.21"
|
6
6
|
s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
|
7
7
|
s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
|
8
8
|
|
data/setup.rb
CHANGED
Binary file
|
@@ -26,14 +26,14 @@ class TestBundledCA < Gem::TestCase
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def assert_https(host)
|
29
|
-
|
29
|
+
assert true
|
30
30
|
http = Net::HTTP.new(host, 443)
|
31
31
|
http.use_ssl = true
|
32
32
|
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
33
33
|
http.cert_store = bundled_certificate_store
|
34
34
|
http.get('/')
|
35
35
|
rescue Errno::ENOENT, Errno::ETIMEDOUT, SocketError
|
36
|
-
|
36
|
+
pend "#{host} seems offline, I can't tell whether ssl would work."
|
37
37
|
rescue OpenSSL::SSL::SSLError => e
|
38
38
|
# Only fail for certificate verification errors
|
39
39
|
if e.message =~ /certificate verify failed/
|
@@ -96,7 +96,7 @@ class TestDeprecate < Gem::TestCase
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def test_deprecated_method_calls_the_old_method
|
99
|
-
|
99
|
+
capture_output do
|
100
100
|
thing = Thing.new
|
101
101
|
thing.foo
|
102
102
|
assert_equal "foo", thing.message
|
@@ -108,7 +108,7 @@ class TestDeprecate < Gem::TestCase
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def test_deprecated_method_outputs_a_warning
|
111
|
-
out, err =
|
111
|
+
out, err = capture_output do
|
112
112
|
thing = Thing.new
|
113
113
|
thing.foo
|
114
114
|
thing.foo_arg("msg")
|
@@ -141,7 +141,7 @@ class TestDeprecate < Gem::TestCase
|
|
141
141
|
end
|
142
142
|
|
143
143
|
def test_deprecated_method_outputs_a_warning_old_way
|
144
|
-
out, err =
|
144
|
+
out, err = capture_output do
|
145
145
|
thing = OtherThing.new
|
146
146
|
thing.foo
|
147
147
|
thing.foo_arg("msg")
|
data/test/rubygems/test_gem.rb
CHANGED
@@ -106,7 +106,7 @@ class TestGem < Gem::TestCase
|
|
106
106
|
|
107
107
|
assert_equal %w[a-1], installed.map {|spec| spec.full_name }
|
108
108
|
|
109
|
-
|
109
|
+
assert_path_exist File.join(gemhome2, 'gems', 'a-1')
|
110
110
|
end
|
111
111
|
|
112
112
|
def test_self_install_in_rescue
|
@@ -212,7 +212,7 @@ class TestGem < Gem::TestCase
|
|
212
212
|
|
213
213
|
def test_require_missing
|
214
214
|
save_loaded_features do
|
215
|
-
|
215
|
+
assert_raise ::LoadError do
|
216
216
|
require "test_require_missing"
|
217
217
|
end
|
218
218
|
end
|
@@ -224,7 +224,7 @@ class TestGem < Gem::TestCase
|
|
224
224
|
|
225
225
|
install_specs a1
|
226
226
|
|
227
|
-
|
227
|
+
assert_raise ::LoadError do
|
228
228
|
require "a*"
|
229
229
|
end
|
230
230
|
|
@@ -261,7 +261,7 @@ class TestGem < Gem::TestCase
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def test_self_activate_bin_path_no_exec_name
|
264
|
-
e =
|
264
|
+
e = assert_raise ArgumentError do
|
265
265
|
Gem.activate_bin_path 'a'
|
266
266
|
end
|
267
267
|
|
@@ -342,7 +342,7 @@ class TestGem < Gem::TestCase
|
|
342
342
|
|
343
343
|
# c2 is missing, and b2 which has it as a dependency will be activated, so we should get an error about the orphaned dependency
|
344
344
|
|
345
|
-
e =
|
345
|
+
e = assert_raise Gem::UnsatisfiableDependencyError do
|
346
346
|
load Gem.activate_bin_path("a", "exec", ">= 0")
|
347
347
|
end
|
348
348
|
|
@@ -390,7 +390,7 @@ class TestGem < Gem::TestCase
|
|
390
390
|
|
391
391
|
File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
|
392
392
|
|
393
|
-
e =
|
393
|
+
e = assert_raise Gem::GemNotFoundException do
|
394
394
|
load Gem.activate_bin_path("bundler", "bundle", ">= 0.a")
|
395
395
|
end
|
396
396
|
|
@@ -487,7 +487,7 @@ class TestGem < Gem::TestCase
|
|
487
487
|
|
488
488
|
File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
|
489
489
|
|
490
|
-
e =
|
490
|
+
e = assert_raise Gem::GemNotFoundException do
|
491
491
|
load Gem.activate_bin_path("bundler", "bundle", "= 2.2.8")
|
492
492
|
end
|
493
493
|
|
@@ -495,7 +495,7 @@ class TestGem < Gem::TestCase
|
|
495
495
|
end
|
496
496
|
|
497
497
|
def test_self_bin_path_no_exec_name
|
498
|
-
e =
|
498
|
+
e = assert_raise ArgumentError do
|
499
499
|
Gem.bin_path 'a'
|
500
500
|
end
|
501
501
|
|
@@ -516,20 +516,20 @@ class TestGem < Gem::TestCase
|
|
516
516
|
util_spec 'a', '2' do |s|
|
517
517
|
s.executables = ['exec']
|
518
518
|
end
|
519
|
-
|
519
|
+
assert_raise(Gem::GemNotFoundException) do
|
520
520
|
Gem.bin_path('a', 'other', '2')
|
521
521
|
end
|
522
522
|
end
|
523
523
|
|
524
524
|
def test_self_bin_path_no_bin_file
|
525
525
|
util_spec 'a', '1'
|
526
|
-
|
526
|
+
assert_raise(ArgumentError) do
|
527
527
|
Gem.bin_path('a', nil, '1')
|
528
528
|
end
|
529
529
|
end
|
530
530
|
|
531
531
|
def test_self_bin_path_not_found
|
532
|
-
|
532
|
+
assert_raise(Gem::GemNotFoundException) do
|
533
533
|
Gem.bin_path('non-existent', 'blah')
|
534
534
|
end
|
535
535
|
end
|
@@ -596,7 +596,7 @@ class TestGem < Gem::TestCase
|
|
596
596
|
end
|
597
597
|
|
598
598
|
def test_self_datadir_nonexistent_package
|
599
|
-
|
599
|
+
assert_raise(Gem::MissingSpecError) do
|
600
600
|
Gem::Specification.find_by_name("xyzzy").datadir
|
601
601
|
end
|
602
602
|
end
|
@@ -692,12 +692,12 @@ class TestGem < Gem::TestCase
|
|
692
692
|
|
693
693
|
Gem.ensure_gem_subdirectories @gemhome
|
694
694
|
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
695
|
+
assert_path_exist File.join @gemhome, 'build_info'
|
696
|
+
assert_path_exist File.join @gemhome, 'cache'
|
697
|
+
assert_path_exist File.join @gemhome, 'doc'
|
698
|
+
assert_path_exist File.join @gemhome, 'extensions'
|
699
|
+
assert_path_exist File.join @gemhome, 'gems'
|
700
|
+
assert_path_exist File.join @gemhome, 'specifications'
|
701
701
|
end
|
702
702
|
|
703
703
|
def test_self_ensure_gem_directories_permissions
|
@@ -1058,7 +1058,7 @@ class TestGem < Gem::TestCase
|
|
1058
1058
|
|
1059
1059
|
assert_equal ["\xCF", "\x80"], Gem.read_binary('test').chars.to_a
|
1060
1060
|
|
1061
|
-
|
1061
|
+
pend 'chmod not supported' if Gem.win_platform?
|
1062
1062
|
|
1063
1063
|
begin
|
1064
1064
|
File.chmod 0444, 'test'
|
@@ -1144,7 +1144,7 @@ class TestGem < Gem::TestCase
|
|
1144
1144
|
|
1145
1145
|
assert_equal Gem::Requirement.create('>= 1.2.3'), Gem.env_requirement('foo')
|
1146
1146
|
assert_equal Gem::Requirement.create('1.2.3'), Gem.env_requirement('bAr')
|
1147
|
-
|
1147
|
+
assert_raise(Gem::Requirement::BadRequirementError) { Gem.env_requirement('baz') }
|
1148
1148
|
assert_equal Gem::Requirement.default, Gem.env_requirement('qux')
|
1149
1149
|
end
|
1150
1150
|
|
@@ -1349,7 +1349,7 @@ class TestGem < Gem::TestCase
|
|
1349
1349
|
io.puts '# a_file.rb'
|
1350
1350
|
end
|
1351
1351
|
|
1352
|
-
e =
|
1352
|
+
e = assert_raise Gem::MissingSpecError do
|
1353
1353
|
Gem.try_activate 'a_file'
|
1354
1354
|
end
|
1355
1355
|
|
@@ -1370,7 +1370,7 @@ class TestGem < Gem::TestCase
|
|
1370
1370
|
io.puts '# a_file.rb'
|
1371
1371
|
end
|
1372
1372
|
|
1373
|
-
e =
|
1373
|
+
e = assert_raise Gem::MissingSpecError do
|
1374
1374
|
Gem.try_activate 'a_file'
|
1375
1375
|
end
|
1376
1376
|
|
@@ -1389,7 +1389,7 @@ class TestGem < Gem::TestCase
|
|
1389
1389
|
io.write spec.to_ruby_for_cache
|
1390
1390
|
end
|
1391
1391
|
|
1392
|
-
_, err =
|
1392
|
+
_, err = capture_output do
|
1393
1393
|
refute Gem.try_activate 'nonexistent'
|
1394
1394
|
end
|
1395
1395
|
|
@@ -1414,7 +1414,7 @@ class TestGem < Gem::TestCase
|
|
1414
1414
|
end
|
1415
1415
|
|
1416
1416
|
def test_setting_paths_does_not_warn_about_unknown_keys
|
1417
|
-
stdout, stderr =
|
1417
|
+
stdout, stderr = capture_output do
|
1418
1418
|
Gem.paths = { 'foo' => [],
|
1419
1419
|
'bar' => Object.new,
|
1420
1420
|
'GEM_HOME' => Gem.paths.home,
|
@@ -1432,7 +1432,7 @@ class TestGem < Gem::TestCase
|
|
1432
1432
|
end
|
1433
1433
|
|
1434
1434
|
def test_deprecated_paths=
|
1435
|
-
stdout, stderr =
|
1435
|
+
stdout, stderr = capture_output do
|
1436
1436
|
Gem.paths = { 'GEM_HOME' => Gem.paths.home,
|
1437
1437
|
'GEM_PATH' => [Gem.paths.home, 'foo'] }
|
1438
1438
|
end
|
@@ -1727,7 +1727,7 @@ class TestGem < Gem::TestCase
|
|
1727
1727
|
end
|
1728
1728
|
|
1729
1729
|
def test_looks_for_gemdeps_files_automatically_on_start
|
1730
|
-
|
1730
|
+
pend "Requiring bundler messes things up" if Gem.java_platform?
|
1731
1731
|
|
1732
1732
|
a = util_spec "a", "1", nil, "lib/a.rb"
|
1733
1733
|
b = util_spec "b", "1", nil, "lib/b.rb"
|
@@ -1763,7 +1763,7 @@ class TestGem < Gem::TestCase
|
|
1763
1763
|
end
|
1764
1764
|
|
1765
1765
|
def test_looks_for_gemdeps_files_automatically_on_start_in_parent_dir
|
1766
|
-
|
1766
|
+
pend "Requiring bundler messes things up" if Gem.java_platform?
|
1767
1767
|
|
1768
1768
|
a = util_spec "a", "1", nil, "lib/a.rb"
|
1769
1769
|
b = util_spec "b", "1", nil, "lib/b.rb"
|
@@ -1881,7 +1881,7 @@ class TestGem < Gem::TestCase
|
|
1881
1881
|
end
|
1882
1882
|
|
1883
1883
|
def test_use_gemdeps_argument_missing
|
1884
|
-
e =
|
1884
|
+
e = assert_raise ArgumentError do
|
1885
1885
|
Gem.use_gemdeps 'gem.deps.rb'
|
1886
1886
|
end
|
1887
1887
|
|
@@ -1893,7 +1893,7 @@ class TestGem < Gem::TestCase
|
|
1893
1893
|
rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] =
|
1894
1894
|
ENV['RUBYGEMS_GEMDEPS'], 'gem.deps.rb'
|
1895
1895
|
|
1896
|
-
e =
|
1896
|
+
e = assert_raise ArgumentError do
|
1897
1897
|
Gem.use_gemdeps 'gem.deps.rb'
|
1898
1898
|
end
|
1899
1899
|
|
@@ -1966,9 +1966,11 @@ You may need to `gem install -g` to install missing gems
|
|
1966
1966
|
EXPECTED
|
1967
1967
|
|
1968
1968
|
Gem::Deprecate.skip_during do
|
1969
|
-
|
1969
|
+
actual_stdout, actual_stderr = capture_output do
|
1970
1970
|
Gem.use_gemdeps
|
1971
1971
|
end
|
1972
|
+
assert_empty actual_stdout
|
1973
|
+
assert_equal(expected, actual_stderr)
|
1972
1974
|
end
|
1973
1975
|
ensure
|
1974
1976
|
ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
|
@@ -2073,7 +2075,7 @@ You may need to `gem install -g` to install missing gems
|
|
2073
2075
|
refute_includes $LOAD_PATH, test_plugin_path
|
2074
2076
|
$LOAD_PATH.unshift test_plugin_path
|
2075
2077
|
|
2076
|
-
|
2078
|
+
capture_output do
|
2077
2079
|
yield
|
2078
2080
|
end
|
2079
2081
|
ensure
|
@@ -6,14 +6,12 @@ class TestGemBundlerVersionFinder < Gem::TestCase
|
|
6
6
|
super
|
7
7
|
|
8
8
|
@argv = ARGV.dup
|
9
|
-
@env = ENV.to_hash.clone
|
10
|
-
ENV.delete("BUNDLER_VERSION")
|
11
9
|
@dollar_0 = $0
|
10
|
+
without_any_upwards_gemfiles
|
12
11
|
end
|
13
12
|
|
14
13
|
def teardown
|
15
14
|
ARGV.replace @argv
|
16
|
-
ENV.replace @env
|
17
15
|
$0 = @dollar_0
|
18
16
|
|
19
17
|
super
|
@@ -78,8 +76,8 @@ class TestGemBundlerVersionFinder < Gem::TestCase
|
|
78
76
|
end
|
79
77
|
|
80
78
|
def test_deleted_directory
|
81
|
-
|
82
|
-
|
79
|
+
pend "Cannot perform this test on windows" if win_platform?
|
80
|
+
pend "Cannot perform this test on Solaris" if /solaris/ =~ RUBY_PLATFORM
|
83
81
|
require "tmpdir"
|
84
82
|
|
85
83
|
orig_dir = Dir.pwd
|
@@ -118,7 +118,7 @@ class TestGemCommand < Gem::TestCase
|
|
118
118
|
use_ui @ui do
|
119
119
|
@cmd.when_invoked { true }
|
120
120
|
|
121
|
-
ex =
|
121
|
+
ex = assert_raise OptionParser::InvalidOption do
|
122
122
|
@cmd.invoke('-zzz')
|
123
123
|
end
|
124
124
|
|
@@ -189,6 +189,18 @@ class TestGemCommand < Gem::TestCase
|
|
189
189
|
assert_match %r{Usage: gem doit}, @ui.output
|
190
190
|
end
|
191
191
|
|
192
|
+
def test_add_option
|
193
|
+
assert_nothing_raised RuntimeError do
|
194
|
+
@cmd.add_option('--force', 'skip validation of the spec') {|v,o| }
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
def test_add_option_with_empty
|
199
|
+
assert_raise RuntimeError, "Do not pass an empty string in opts" do
|
200
|
+
@cmd.add_option('', 'skip validation of the spec') {|v,o| }
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
192
204
|
def test_option_recognition
|
193
205
|
@cmd.add_option('-h', '--help [COMMAND]', 'Get help on COMMAND') do |value, options|
|
194
206
|
options[:help] = true
|
@@ -22,7 +22,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_find_command_ambiguous
|
25
|
-
e =
|
25
|
+
e = assert_raise Gem::CommandLineError do
|
26
26
|
@command_manager.find_command 'u'
|
27
27
|
end
|
28
28
|
|
@@ -50,7 +50,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_find_command_unknown
|
53
|
-
e =
|
53
|
+
e = assert_raise Gem::CommandLineError do
|
54
54
|
@command_manager.find_command 'xyz'
|
55
55
|
end
|
56
56
|
|
@@ -65,7 +65,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
65
65
|
@command_manager.register_command :interrupt
|
66
66
|
|
67
67
|
use_ui @ui do
|
68
|
-
|
68
|
+
assert_raise Gem::MockGemUi::TermError do
|
69
69
|
@command_manager.run %w[interrupt]
|
70
70
|
end
|
71
71
|
assert_equal '', ui.output
|
@@ -82,7 +82,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
82
82
|
|
83
83
|
@command_manager.register_command :crash
|
84
84
|
use_ui @ui do
|
85
|
-
|
85
|
+
assert_raise Gem::MockGemUi::TermError do
|
86
86
|
@command_manager.run %w[crash]
|
87
87
|
end
|
88
88
|
assert_equal '', ui.output
|
@@ -96,7 +96,7 @@ class TestGemCommandManager < Gem::TestCase
|
|
96
96
|
|
97
97
|
def test_process_args_bad_arg
|
98
98
|
use_ui @ui do
|
99
|
-
|
99
|
+
assert_raise Gem::MockGemUi::TermError do
|
100
100
|
@command_manager.process_args %w[--bad-arg]
|
101
101
|
end
|
102
102
|
end
|
@@ -126,7 +126,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
126
126
|
|
127
127
|
use_ui @ui do
|
128
128
|
Dir.chdir @tempdir do
|
129
|
-
|
129
|
+
assert_raise Gem::InvalidSpecificationException do
|
130
130
|
@cmd.execute
|
131
131
|
end
|
132
132
|
end
|
@@ -180,7 +180,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
180
180
|
|
181
181
|
use_ui @ui do
|
182
182
|
Dir.chdir @tempdir do
|
183
|
-
|
183
|
+
assert_raise Gem::InvalidSpecificationException do
|
184
184
|
@cmd.execute
|
185
185
|
end
|
186
186
|
end
|
@@ -208,8 +208,8 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
208
208
|
@cmd.options[:args] = [gemspec_file]
|
209
209
|
|
210
210
|
out, err = use_ui @ui do
|
211
|
-
|
212
|
-
|
211
|
+
capture_output do
|
212
|
+
assert_raise Gem::MockGemUi::TermError do
|
213
213
|
@cmd.execute
|
214
214
|
end
|
215
215
|
end
|
@@ -225,7 +225,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
225
225
|
def test_execute_missing_file
|
226
226
|
@cmd.options[:args] = %w[some_gem]
|
227
227
|
use_ui @ui do
|
228
|
-
|
228
|
+
assert_raise Gem::MockGemUi::TermError do
|
229
229
|
@cmd.execute
|
230
230
|
end
|
231
231
|
end
|
@@ -329,7 +329,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
329
329
|
@cmd.options[:args] = ["*.gemspec"]
|
330
330
|
|
331
331
|
use_ui @ui do
|
332
|
-
|
332
|
+
assert_raise Gem::MockGemUi::TermError do
|
333
333
|
@cmd.execute
|
334
334
|
end
|
335
335
|
end
|
@@ -527,7 +527,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
527
527
|
|
528
528
|
use_ui @ui do
|
529
529
|
Dir.chdir(gemspec_dir) do
|
530
|
-
|
530
|
+
assert_raise Gem::MockGemUi::TermError do
|
531
531
|
@cmd.execute
|
532
532
|
end
|
533
533
|
end
|
@@ -582,7 +582,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
582
582
|
end
|
583
583
|
|
584
584
|
def test_build_signed_gem
|
585
|
-
|
585
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
|
586
586
|
|
587
587
|
trust_dir = Gem::Security.trust_dir
|
588
588
|
|
@@ -609,7 +609,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
609
609
|
end
|
610
610
|
|
611
611
|
def test_build_signed_gem_with_cert_expiration_length_days
|
612
|
-
|
612
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
|
613
613
|
|
614
614
|
gem_path = File.join Gem.user_home, ".gem"
|
615
615
|
Dir.mkdir gem_path
|
@@ -653,7 +653,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|
653
653
|
end
|
654
654
|
|
655
655
|
def test_build_auto_resign_cert
|
656
|
-
|
656
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL && !java_platform?
|
657
657
|
|
658
658
|
gem_path = File.join Gem.user_home, ".gem"
|
659
659
|
Dir.mkdir gem_path
|