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
@@ -162,7 +162,7 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
162
162
|
|
163
163
|
use_ui ui do
|
164
164
|
|
165
|
-
|
165
|
+
assert_raise Gem::MockGemUi::TermError do
|
166
166
|
@cmd.execute
|
167
167
|
end
|
168
168
|
end
|
@@ -188,7 +188,7 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
188
188
|
@cmd.handle_options %w[--add http://beta-gems.example.com]
|
189
189
|
|
190
190
|
use_ui @ui do
|
191
|
-
|
191
|
+
assert_raise Gem::MockGemUi::TermError do
|
192
192
|
@cmd.execute
|
193
193
|
end
|
194
194
|
end
|
@@ -299,7 +299,7 @@ source http://gems.example.com/ already present in the cache
|
|
299
299
|
ui = Gem::MockGemUi.new "n"
|
300
300
|
|
301
301
|
use_ui ui do
|
302
|
-
|
302
|
+
assert_raise Gem::MockGemUi::TermError do
|
303
303
|
@cmd.execute
|
304
304
|
end
|
305
305
|
end
|
@@ -367,7 +367,7 @@ source http://gems.example.com/ already present in the cache
|
|
367
367
|
ui = Gem::MockGemUi.new "n"
|
368
368
|
|
369
369
|
use_ui ui do
|
370
|
-
|
370
|
+
assert_raise Gem::MockGemUi::TermError do
|
371
371
|
@cmd.execute
|
372
372
|
end
|
373
373
|
end
|
@@ -385,7 +385,7 @@ source http://gems.example.com/ already present in the cache
|
|
385
385
|
@cmd.handle_options %w[--add beta-gems.example.com]
|
386
386
|
|
387
387
|
use_ui @ui do
|
388
|
-
|
388
|
+
assert_raise Gem::MockGemUi::TermError do
|
389
389
|
@cmd.execute
|
390
390
|
end
|
391
391
|
end
|
@@ -51,7 +51,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
51
51
|
@cmd.options[:all] = true
|
52
52
|
@cmd.options[:version] = "1"
|
53
53
|
|
54
|
-
|
54
|
+
assert_raise Gem::MockGemUi::TermError do
|
55
55
|
use_ui @ui do
|
56
56
|
@cmd.execute
|
57
57
|
end
|
@@ -64,7 +64,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
64
64
|
def test_execute_bad_name
|
65
65
|
@cmd.options[:args] = %w[foo]
|
66
66
|
|
67
|
-
|
67
|
+
assert_raise Gem::MockGemUi::TermError do
|
68
68
|
use_ui @ui do
|
69
69
|
@cmd.execute
|
70
70
|
end
|
@@ -78,7 +78,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
78
78
|
@cmd.options[:args] = %w[foo]
|
79
79
|
@cmd.options[:version] = "1.3.2"
|
80
80
|
|
81
|
-
|
81
|
+
assert_raise Gem::MockGemUi::TermError do
|
82
82
|
use_ui @ui do
|
83
83
|
@cmd.execute
|
84
84
|
end
|
@@ -114,7 +114,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
114
114
|
@cmd.execute
|
115
115
|
end
|
116
116
|
|
117
|
-
assert_equal "foo",
|
117
|
+
assert_equal "foo", load_yaml(@ui.output)
|
118
118
|
end
|
119
119
|
|
120
120
|
def test_execute_file
|
@@ -230,7 +230,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
230
230
|
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
|
231
231
|
assert_match %r{name: foo}, @ui.output
|
232
232
|
|
233
|
-
spec =
|
233
|
+
spec = load_yaml @ui.output
|
234
234
|
|
235
235
|
assert_equal Gem::Version.new("2.0.0"), spec.version
|
236
236
|
end
|
@@ -252,7 +252,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
252
252
|
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
|
253
253
|
assert_match %r{name: foo}, @ui.output
|
254
254
|
|
255
|
-
spec =
|
255
|
+
spec = load_yaml @ui.output
|
256
256
|
|
257
257
|
assert_equal Gem::Version.new("2.0.1.pre"), spec.version
|
258
258
|
end
|
@@ -377,7 +377,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
|
|
377
377
|
|
378
378
|
@cmd.options[:args] = ['a:4']
|
379
379
|
|
380
|
-
e =
|
380
|
+
e = assert_raise Gem::InstallError do
|
381
381
|
use_ui ui do
|
382
382
|
@cmd.execute
|
383
383
|
end
|
@@ -420,7 +420,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
|
|
420
420
|
@cmd.options[:version] = Gem::Requirement.new("> 1")
|
421
421
|
|
422
422
|
use_ui @ui do
|
423
|
-
e =
|
423
|
+
e = assert_raise Gem::MockGemUi::TermError do
|
424
424
|
@cmd.execute
|
425
425
|
end
|
426
426
|
|
@@ -436,7 +436,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
|
|
436
436
|
|
437
437
|
def test_handle_options_vendor_missing
|
438
438
|
vendordir(nil) do
|
439
|
-
e =
|
439
|
+
e = assert_raise OptionParser::InvalidOption do
|
440
440
|
@cmd.handle_options %w[--vendor]
|
441
441
|
end
|
442
442
|
|
@@ -477,7 +477,7 @@ WARNING: Use your OS package manager to uninstall vendor gems
|
|
477
477
|
e = nil
|
478
478
|
@cmd.stub :uninstall, uninstall_exception do
|
479
479
|
use_ui @ui do
|
480
|
-
e =
|
480
|
+
e = assert_raise Gem::MockGemUi::TermError do
|
481
481
|
@cmd.execute
|
482
482
|
end
|
483
483
|
end
|
@@ -151,7 +151,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
151
151
|
end
|
152
152
|
|
153
153
|
def test_execute_sudo
|
154
|
-
|
154
|
+
pend 'Cannot perform this test on windows (chmod)' if win_platform?
|
155
155
|
|
156
156
|
util_make_gems
|
157
157
|
|
@@ -210,7 +210,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
-
|
213
|
+
assert_path_exist File.join(@tempdir, foo_spec.full_name)
|
214
214
|
end
|
215
215
|
|
216
216
|
def test_handle_options_metadata
|
@@ -95,7 +95,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
95
95
|
@cmd.options[:args] = []
|
96
96
|
@cmd.options[:system] = true
|
97
97
|
|
98
|
-
|
98
|
+
assert_raise Gem::MockGemUi::SystemExitException do
|
99
99
|
use_ui @ui do
|
100
100
|
@cmd.execute
|
101
101
|
end
|
@@ -177,7 +177,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
177
177
|
|
178
178
|
@cmd.extend(oldest_version_mod)
|
179
179
|
|
180
|
-
|
180
|
+
assert_raise Gem::MockGemUi::TermError do
|
181
181
|
use_ui @ui do
|
182
182
|
@cmd.execute
|
183
183
|
end
|
@@ -211,7 +211,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
211
211
|
|
212
212
|
@cmd.execute
|
213
213
|
|
214
|
-
|
214
|
+
assert_path_not_exist Gem.plugindir, "Plugins folder not removed when updating rubygems to pre-3.2"
|
215
215
|
end
|
216
216
|
|
217
217
|
def test_execute_system_specific_newer_than_or_equal_to_3_2_leaves_plugins_dir_alone
|
@@ -239,8 +239,8 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
239
239
|
|
240
240
|
@cmd.execute
|
241
241
|
|
242
|
-
|
243
|
-
|
242
|
+
assert_path_exist Gem.plugindir, "Plugin folder removed when updating rubygems to post-3.2"
|
243
|
+
assert_path_exist plugin_file, "Plugin removed when updating rubygems to post-3.2"
|
244
244
|
end
|
245
245
|
|
246
246
|
def test_execute_system_specifically_to_latest_version
|
@@ -273,7 +273,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
273
273
|
@cmd.options[:args] = %w[gem]
|
274
274
|
@cmd.options[:system] = true
|
275
275
|
|
276
|
-
|
276
|
+
assert_raise Gem::MockGemUi::TermError do
|
277
277
|
use_ui @ui do
|
278
278
|
@cmd.execute
|
279
279
|
end
|
@@ -291,7 +291,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
291
291
|
@cmd.options[:args] = []
|
292
292
|
@cmd.options[:system] = true
|
293
293
|
|
294
|
-
|
294
|
+
assert_raise Gem::MockGemUi::TermError do
|
295
295
|
use_ui @ui do
|
296
296
|
@cmd.execute
|
297
297
|
end
|
@@ -384,7 +384,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
384
384
|
|
385
385
|
a2 = @specs['a-2']
|
386
386
|
|
387
|
-
|
387
|
+
assert_path_exist File.join(a2.doc_dir, 'rdoc')
|
388
388
|
end
|
389
389
|
|
390
390
|
def test_execute_named
|
@@ -530,7 +530,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
530
530
|
def test_fetch_remote_gems_error
|
531
531
|
Gem.sources.replace %w[http://nonexistent.example]
|
532
532
|
|
533
|
-
|
533
|
+
assert_raise Gem::RemoteFetcher::FetchError do
|
534
534
|
@cmd.fetch_remote_gems @specs['a-1']
|
535
535
|
end
|
536
536
|
end
|
@@ -588,7 +588,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
588
588
|
end
|
589
589
|
|
590
590
|
def test_handle_options_system_non_version
|
591
|
-
|
591
|
+
assert_raise ArgumentError do
|
592
592
|
@cmd.handle_options %w[--system non-version]
|
593
593
|
end
|
594
594
|
end
|
@@ -26,7 +26,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
|
|
26
26
|
@cmd.handle_options %w[directory]
|
27
27
|
|
28
28
|
use_ui @ui do
|
29
|
-
|
29
|
+
assert_raise Gem::MockGemUi::TermError do
|
30
30
|
@cmd.execute
|
31
31
|
end
|
32
32
|
end
|
@@ -44,7 +44,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
|
|
44
44
|
@cmd.handle_options %w[foo_bar missinglib]
|
45
45
|
|
46
46
|
use_ui @ui do
|
47
|
-
|
47
|
+
assert_raise Gem::MockGemUi::TermError do
|
48
48
|
@cmd.execute
|
49
49
|
end
|
50
50
|
end
|
@@ -58,7 +58,7 @@ class TestGemCommandsWhichCommand < Gem::TestCase
|
|
58
58
|
@cmd.handle_options %w[missinglib]
|
59
59
|
|
60
60
|
use_ui @ui do
|
61
|
-
|
61
|
+
assert_raise Gem::MockGemUi::TermError do
|
62
62
|
@cmd.execute
|
63
63
|
end
|
64
64
|
end
|
@@ -35,7 +35,7 @@ class TestGemCommandsYankCommand < Gem::TestCase
|
|
35
35
|
|
36
36
|
def test_handle_options_missing_argument
|
37
37
|
%w[-v --version -p --platform].each do |option|
|
38
|
-
|
38
|
+
assert_raise OptionParser::MissingArgument do
|
39
39
|
@cmd.handle_options %W[a #{option}]
|
40
40
|
end
|
41
41
|
end
|
@@ -195,14 +195,14 @@ class TestGemConfigFile < Gem::TestCase
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def test_check_credentials_permissions
|
198
|
-
|
198
|
+
pend 'chmod not supported' if win_platform?
|
199
199
|
|
200
200
|
@cfg.rubygems_api_key = 'x'
|
201
201
|
|
202
202
|
File.chmod 0644, @cfg.credentials_path
|
203
203
|
|
204
204
|
use_ui @ui do
|
205
|
-
|
205
|
+
assert_raise Gem::MockGemUi::TermError do
|
206
206
|
@cfg.load_api_keys
|
207
207
|
end
|
208
208
|
end
|
@@ -253,7 +253,7 @@ if you believe they were disclosed to a third party.
|
|
253
253
|
|
254
254
|
args = %w[--debug]
|
255
255
|
|
256
|
-
_, err =
|
256
|
+
_, err = capture_output do
|
257
257
|
@cfg.handle_arguments args
|
258
258
|
end
|
259
259
|
|
@@ -322,13 +322,13 @@ if you believe they were disclosed to a third party.
|
|
322
322
|
end
|
323
323
|
|
324
324
|
def test_load_api_keys_bad_permission
|
325
|
-
|
325
|
+
pend 'chmod not supported' if win_platform?
|
326
326
|
|
327
327
|
@cfg.rubygems_api_key = 'x'
|
328
328
|
|
329
329
|
File.chmod 0644, @cfg.credentials_path
|
330
330
|
|
331
|
-
|
331
|
+
assert_raise Gem::MockGemUi::TermError do
|
332
332
|
@cfg.load_api_keys
|
333
333
|
end
|
334
334
|
end
|
@@ -354,7 +354,7 @@ if you believe they were disclosed to a third party.
|
|
354
354
|
:rubygems_api_key => 'x',
|
355
355
|
}
|
356
356
|
|
357
|
-
assert_equal expected,
|
357
|
+
assert_equal expected, load_yaml_file(@cfg.credentials_path)
|
358
358
|
|
359
359
|
unless win_platform?
|
360
360
|
stat = File.stat @cfg.credentials_path
|
@@ -364,13 +364,13 @@ if you believe they were disclosed to a third party.
|
|
364
364
|
end
|
365
365
|
|
366
366
|
def test_rubygems_api_key_equals_bad_permission
|
367
|
-
|
367
|
+
pend 'chmod not supported' if win_platform?
|
368
368
|
|
369
369
|
@cfg.rubygems_api_key = 'x'
|
370
370
|
|
371
371
|
File.chmod 0644, @cfg.credentials_path
|
372
372
|
|
373
|
-
|
373
|
+
assert_raise Gem::MockGemUi::TermError do
|
374
374
|
@cfg.rubygems_api_key = 'y'
|
375
375
|
end
|
376
376
|
|
@@ -378,7 +378,7 @@ if you believe they were disclosed to a third party.
|
|
378
378
|
:rubygems_api_key => 'x',
|
379
379
|
}
|
380
380
|
|
381
|
-
assert_equal expected,
|
381
|
+
assert_equal expected, load_yaml_file(@cfg.credentials_path)
|
382
382
|
|
383
383
|
stat = File.stat @cfg.credentials_path
|
384
384
|
|
@@ -3,6 +3,12 @@ require 'rubygems/test_case'
|
|
3
3
|
require 'rubygems/dependency'
|
4
4
|
|
5
5
|
class TestGemDependency < Gem::TestCase
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
|
9
|
+
without_any_upwards_gemfiles
|
10
|
+
end
|
11
|
+
|
6
12
|
def test_initialize
|
7
13
|
d = dep "pkg", "> 1.0"
|
8
14
|
|
@@ -11,7 +17,7 @@ class TestGemDependency < Gem::TestCase
|
|
11
17
|
end
|
12
18
|
|
13
19
|
def test_initialize_type_bad
|
14
|
-
e =
|
20
|
+
e = assert_raise ArgumentError do
|
15
21
|
Gem::Dependency.new 'monkey' => '1.0'
|
16
22
|
end
|
17
23
|
|
@@ -43,7 +49,7 @@ class TestGemDependency < Gem::TestCase
|
|
43
49
|
assert_equal :runtime, dep("pkg").type
|
44
50
|
assert_equal :development, dep("pkg", [], :development).type
|
45
51
|
|
46
|
-
|
52
|
+
assert_raise ArgumentError do
|
47
53
|
dep "pkg", :sometimes
|
48
54
|
end
|
49
55
|
end
|
@@ -248,7 +254,7 @@ class TestGemDependency < Gem::TestCase
|
|
248
254
|
a = dep 'a'
|
249
255
|
b = dep 'b'
|
250
256
|
|
251
|
-
e =
|
257
|
+
e = assert_raise ArgumentError do
|
252
258
|
a.merge b
|
253
259
|
end
|
254
260
|
|
@@ -330,7 +336,7 @@ class TestGemDependency < Gem::TestCase
|
|
330
336
|
|
331
337
|
dep = Gem::Dependency.new "a", "= 2.0"
|
332
338
|
|
333
|
-
e =
|
339
|
+
e = assert_raise Gem::MissingSpecVersionError do
|
334
340
|
dep.to_specs
|
335
341
|
end
|
336
342
|
|
@@ -353,7 +359,7 @@ class TestGemDependency < Gem::TestCase
|
|
353
359
|
assert_equal [b, b_1], dep.to_specs
|
354
360
|
|
355
361
|
Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["3.5", "reason"]) do
|
356
|
-
e =
|
362
|
+
e = assert_raise Gem::MissingSpecVersionError do
|
357
363
|
dep.to_specs
|
358
364
|
end
|
359
365
|
|
@@ -377,7 +383,7 @@ class TestGemDependency < Gem::TestCase
|
|
377
383
|
|
378
384
|
dep = Gem::Dependency.new "b", "= 2.0"
|
379
385
|
|
380
|
-
e =
|
386
|
+
e = assert_raise Gem::MissingSpecError do
|
381
387
|
dep.to_specs
|
382
388
|
end
|
383
389
|
|
@@ -113,7 +113,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
113
113
|
|
114
114
|
dep = Gem::Dependency.new "p"
|
115
115
|
inst = Gem::DependencyInstaller.new
|
116
|
-
|
116
|
+
assert_raise Gem::UnsatisfiableDependencyError do
|
117
117
|
inst.install dep
|
118
118
|
end
|
119
119
|
|
@@ -392,7 +392,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
392
392
|
|
393
393
|
assert_equal %w[f-1], inst.installed_gems.map {|s| s.full_name }
|
394
394
|
|
395
|
-
|
395
|
+
assert_path_exist e1.extension_dir
|
396
396
|
end
|
397
397
|
|
398
398
|
def test_install_dependency_old
|
@@ -712,7 +712,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
712
712
|
inst = nil
|
713
713
|
|
714
714
|
Dir.chdir @tempdir do
|
715
|
-
e =
|
715
|
+
e = assert_raise Gem::UnsatisfiableDependencyError do
|
716
716
|
inst = Gem::DependencyInstaller.new :domain => :local
|
717
717
|
inst.install 'b'
|
718
718
|
end
|
@@ -883,7 +883,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|
883
883
|
policy = Gem::Security::HighSecurity
|
884
884
|
inst = Gem::DependencyInstaller.new :security_policy => policy
|
885
885
|
|
886
|
-
e =
|
886
|
+
e = assert_raise Gem::Security::Exception do
|
887
887
|
inst.install 'b'
|
888
888
|
end
|
889
889
|
|
@@ -27,31 +27,31 @@ class TestGemDoctor < Gem::TestCase
|
|
27
27
|
io.write 'this will raise an exception when evaluated.'
|
28
28
|
end
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
assert_path_exist File.join(a.gem_dir, 'Rakefile')
|
31
|
+
assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
assert_path_exist b.gem_dir
|
34
|
+
assert_path_not_exist b.spec_file
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
assert_path_exist c.gem_dir
|
37
|
+
assert_path_exist c.spec_file
|
38
38
|
|
39
39
|
doctor = Gem::Doctor.new @gemhome
|
40
40
|
|
41
|
-
|
41
|
+
capture_output do
|
42
42
|
use_ui @ui do
|
43
43
|
doctor.doctor
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
|
48
|
-
|
47
|
+
assert_path_exist File.join(a.gem_dir, 'Rakefile')
|
48
|
+
assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
|
49
49
|
|
50
|
-
|
51
|
-
|
50
|
+
assert_path_not_exist b.gem_dir
|
51
|
+
assert_path_not_exist b.spec_file
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
assert_path_not_exist c.gem_dir
|
54
|
+
assert_path_not_exist c.spec_file
|
55
55
|
|
56
56
|
expected = <<-OUTPUT
|
57
57
|
Checking #{@gemhome}
|
@@ -80,31 +80,31 @@ Removed directory gems/c-2
|
|
80
80
|
io.write 'this will raise an exception when evaluated.'
|
81
81
|
end
|
82
82
|
|
83
|
-
|
84
|
-
|
83
|
+
assert_path_exist File.join(a.gem_dir, 'Rakefile')
|
84
|
+
assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
|
85
85
|
|
86
|
-
|
87
|
-
|
86
|
+
assert_path_exist b.gem_dir
|
87
|
+
assert_path_not_exist b.spec_file
|
88
88
|
|
89
|
-
|
90
|
-
|
89
|
+
assert_path_exist c.gem_dir
|
90
|
+
assert_path_exist c.spec_file
|
91
91
|
|
92
92
|
doctor = Gem::Doctor.new @gemhome, true
|
93
93
|
|
94
|
-
|
94
|
+
capture_output do
|
95
95
|
use_ui @ui do
|
96
96
|
doctor.doctor
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
|
100
|
+
assert_path_exist File.join(a.gem_dir, 'Rakefile')
|
101
|
+
assert_path_exist File.join(a.gem_dir, 'lib', 'a.rb')
|
102
102
|
|
103
|
-
|
104
|
-
|
103
|
+
assert_path_exist b.gem_dir
|
104
|
+
assert_path_not_exist b.spec_file
|
105
105
|
|
106
|
-
|
107
|
-
|
106
|
+
assert_path_exist c.gem_dir
|
107
|
+
assert_path_exist c.spec_file
|
108
108
|
|
109
109
|
expected = <<-OUTPUT
|
110
110
|
Checking #{@gemhome}
|
@@ -127,13 +127,13 @@ Extra directory gems/c-2
|
|
127
127
|
|
128
128
|
doctor = Gem::Doctor.new @tempdir
|
129
129
|
|
130
|
-
|
130
|
+
capture_output do
|
131
131
|
use_ui @ui do
|
132
132
|
doctor.doctor
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
|
136
|
+
assert_path_exist other_dir
|
137
137
|
|
138
138
|
expected = <<-OUTPUT
|
139
139
|
Checking #{@tempdir}
|
@@ -163,13 +163,13 @@ This directory does not appear to be a RubyGems repository, skipping
|
|
163
163
|
|
164
164
|
doctor = Gem::Doctor.new @gemhome
|
165
165
|
|
166
|
-
|
166
|
+
capture_output do
|
167
167
|
use_ui @ui do
|
168
168
|
doctor.doctor
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
-
#
|
172
|
+
# assert_path_not_exist bad_plugin
|
173
173
|
|
174
174
|
expected = <<-OUTPUT
|
175
175
|
Checking #{@gemhome}
|