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.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/Manifest.txt +3 -0
  4. data/Rakefile +6 -6
  5. data/bundler/CHANGELOG.md +54 -0
  6. data/bundler/bundler.gemspec +2 -3
  7. data/bundler/lib/bundler.rb +2 -1
  8. data/bundler/lib/bundler/build_metadata.rb +2 -2
  9. data/bundler/lib/bundler/cli.rb +13 -33
  10. data/bundler/lib/bundler/cli/check.rb +4 -2
  11. data/bundler/lib/bundler/cli/install.rb +6 -7
  12. data/bundler/lib/bundler/cli/outdated.rb +9 -10
  13. data/bundler/lib/bundler/definition.rb +29 -82
  14. data/bundler/lib/bundler/feature_flag.rb +0 -2
  15. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  16. data/bundler/lib/bundler/fetcher/index.rb +0 -1
  17. data/bundler/lib/bundler/friendly_errors.rb +2 -4
  18. data/bundler/lib/bundler/index.rb +1 -2
  19. data/bundler/lib/bundler/installer.rb +1 -8
  20. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-config.1 +1 -7
  26. data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -8
  27. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle.1 +1 -1
  45. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  46. data/bundler/lib/bundler/plugin/api/source.rb +14 -0
  47. data/bundler/lib/bundler/resolver.rb +15 -96
  48. data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
  49. data/bundler/lib/bundler/rubygems_ext.rb +2 -2
  50. data/bundler/lib/bundler/rubygems_integration.rb +4 -3
  51. data/bundler/lib/bundler/settings.rb +21 -3
  52. data/bundler/lib/bundler/source.rb +11 -0
  53. data/bundler/lib/bundler/source/rubygems.rb +24 -11
  54. data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
  55. data/bundler/lib/bundler/source_list.rb +35 -10
  56. data/bundler/lib/bundler/source_map.rb +58 -0
  57. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  58. data/bundler/lib/bundler/version.rb +1 -1
  59. data/lib/rubygems.rb +1 -1
  60. data/lib/rubygems/command.rb +2 -0
  61. data/lib/rubygems/commands/build_command.rb +1 -1
  62. data/lib/rubygems/config_file.rb +1 -1
  63. data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
  64. data/lib/rubygems/installer.rb +4 -0
  65. data/lib/rubygems/request.rb +1 -1
  66. data/lib/rubygems/specification.rb +0 -2
  67. data/lib/rubygems/specification_policy.rb +5 -4
  68. data/lib/rubygems/test_case.rb +106 -18
  69. data/lib/rubygems/util/licenses.rb +107 -2
  70. data/rubygems-update.gemspec +1 -1
  71. data/setup.rb +1 -2
  72. data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
  73. data/test/rubygems/test_bundled_ca.rb +2 -2
  74. data/test/rubygems/test_deprecate.rb +3 -3
  75. data/test/rubygems/test_gem.rb +33 -31
  76. data/test/rubygems/test_gem_bundler_version_finder.rb +3 -5
  77. data/test/rubygems/test_gem_command.rb +13 -1
  78. data/test/rubygems/test_gem_command_manager.rb +5 -5
  79. data/test/rubygems/test_gem_commands_build_command.rb +10 -10
  80. data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
  81. data/test/rubygems/test_gem_commands_check_command.rb +5 -5
  82. data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
  83. data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
  84. data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
  85. data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
  86. data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
  87. data/test/rubygems/test_gem_commands_help_command.rb +8 -1
  88. data/test/rubygems/test_gem_commands_install_command.rb +60 -60
  89. data/test/rubygems/test_gem_commands_list_command.rb +1 -1
  90. data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
  91. data/test/rubygems/test_gem_commands_open_command.rb +8 -9
  92. data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
  93. data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
  94. data/test/rubygems/test_gem_commands_push_command.rb +6 -11
  95. data/test/rubygems/test_gem_commands_query_command.rb +7 -7
  96. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  97. data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
  98. data/test/rubygems/test_gem_commands_signin_command.rb +13 -6
  99. data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
  100. data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
  101. data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
  102. data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
  103. data/test/rubygems/test_gem_commands_update_command.rb +10 -10
  104. data/test/rubygems/test_gem_commands_which_command.rb +3 -3
  105. data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
  106. data/test/rubygems/test_gem_config_file.rb +9 -9
  107. data/test/rubygems/test_gem_dependency.rb +12 -6
  108. data/test/rubygems/test_gem_dependency_installer.rb +4 -4
  109. data/test/rubygems/test_gem_doctor.rb +30 -30
  110. data/test/rubygems/test_gem_ext_builder.rb +20 -20
  111. data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
  112. data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
  113. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
  114. data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
  115. data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -14
  116. data/test/rubygems/test_gem_install_update_options.rb +9 -9
  117. data/test/rubygems/test_gem_installer.rb +162 -140
  118. data/test/rubygems/test_gem_local_remote_options.rb +1 -1
  119. data/test/rubygems/test_gem_package.rb +48 -48
  120. data/test/rubygems/test_gem_package_old.rb +9 -9
  121. data/test/rubygems/test_gem_package_tar_header.rb +5 -5
  122. data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
  123. data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
  124. data/test/rubygems/test_gem_package_task.rb +2 -2
  125. data/test/rubygems/test_gem_path_support.rb +1 -1
  126. data/test/rubygems/test_gem_rdoc.rb +9 -9
  127. data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
  128. data/test/rubygems/test_gem_request.rb +2 -2
  129. data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
  130. data/test/rubygems/test_gem_request_set.rb +15 -14
  131. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
  132. data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
  133. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
  134. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
  135. data/test/rubygems/test_gem_requirement.rb +13 -13
  136. data/test/rubygems/test_gem_resolver.rb +11 -11
  137. data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
  138. data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
  139. data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
  140. data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
  141. data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
  142. data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
  143. data/test/rubygems/test_gem_resolver_specification.rb +1 -1
  144. data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
  145. data/test/rubygems/test_gem_security.rb +5 -5
  146. data/test/rubygems/test_gem_security_policy.rb +27 -27
  147. data/test/rubygems/test_gem_security_signer.rb +7 -7
  148. data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
  149. data/test/rubygems/test_gem_server.rb +2 -2
  150. data/test/rubygems/test_gem_silent_ui.rb +9 -9
  151. data/test/rubygems/test_gem_source.rb +2 -2
  152. data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
  153. data/test/rubygems/test_gem_source_git.rb +11 -11
  154. data/test/rubygems/test_gem_source_specific_file.rb +1 -1
  155. data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
  156. data/test/rubygems/test_gem_specification.rb +86 -106
  157. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  158. data/test/rubygems/test_gem_stub_specification.rb +4 -4
  159. data/test/rubygems/test_gem_uninstaller.rb +16 -16
  160. data/test/rubygems/test_gem_util.rb +8 -6
  161. data/test/rubygems/test_gem_version.rb +4 -13
  162. data/test/rubygems/test_kernel.rb +6 -4
  163. data/test/rubygems/test_project_sanity.rb +1 -1
  164. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  165. data/test/rubygems/test_require.rb +12 -14
  166. data/test/test_changelog_generator.rb +1 -2
  167. metadata +6 -3
@@ -20,7 +20,7 @@ class TestGemCommandsListCommand < Gem::TestCase
20
20
  def test_execute_installed
21
21
  @cmd.handle_options %w[c --installed]
22
22
 
23
- assert_raises Gem::MockGemUi::SystemExitException do
23
+ assert_raise Gem::MockGemUi::SystemExitException do
24
24
  use_ui @ui do
25
25
  @cmd.execute
26
26
  end
@@ -55,7 +55,7 @@ gem 'd', '= 1'
55
55
  def test_execute_strict
56
56
  @cmd.handle_options %w[c-1 --strict]
57
57
 
58
- e = assert_raises Gem::Exception do
58
+ e = assert_raise Gem::Exception do
59
59
  use_ui @ui do
60
60
  @cmd.execute
61
61
  end
@@ -25,16 +25,15 @@ class TestGemCommandsOpenCommand < Gem::TestCase
25
25
 
26
26
  gem 'foo', '1.0.0'
27
27
  spec = gem 'foo', '1.0.1'
28
- mock = Minitest::Mock.new
29
- mock.expect(:call, true, [spec.full_gem_path])
30
28
 
31
- Dir.stub(:chdir, mock) do
32
- use_ui @ui do
33
- @cmd.execute
29
+ assert_nothing_raised Gem::MockGemUi::TermError do
30
+ Dir.stub(:chdir, spec.full_gem_path) do
31
+ use_ui @ui do
32
+ @cmd.execute
33
+ end
34
34
  end
35
35
  end
36
36
 
37
- assert mock.verify
38
37
  assert_equal "", @ui.error
39
38
  end
40
39
 
@@ -44,7 +43,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
44
43
 
45
44
  gem "foo", "5.0"
46
45
 
47
- assert_raises Gem::MockGemUi::TermError do
46
+ assert_raise Gem::MockGemUi::TermError do
48
47
  use_ui @ui do
49
48
  @cmd.execute
50
49
  end
@@ -57,7 +56,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
57
56
  def test_execute_bad_gem
58
57
  @cmd.options[:args] = %w[foo]
59
58
 
60
- assert_raises Gem::MockGemUi::TermError do
59
+ assert_raise Gem::MockGemUi::TermError do
61
60
  use_ui @ui do
62
61
  @cmd.execute
63
62
  end
@@ -86,7 +85,7 @@ class TestGemCommandsOpenCommand < Gem::TestCase
86
85
 
87
86
  gem("foo", "1.0")
88
87
 
89
- assert_raises Gem::MockGemUi::TermError do
88
+ assert_raise Gem::MockGemUi::TermError do
90
89
  use_ui @ui do
91
90
  @cmd.execute
92
91
  end
@@ -53,7 +53,7 @@ EOF
53
53
  end
54
54
 
55
55
  def test_show_owners_dont_load_objects
56
- skip "testing a psych-only API" unless defined?(::Psych::DisallowedClass)
56
+ pend "testing a psych-only API" unless defined?(::Psych::DisallowedClass)
57
57
 
58
58
  response = <<EOF
59
59
  ---
@@ -68,7 +68,7 @@ EOF
68
68
 
69
69
  @stub_fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 200, 'OK']
70
70
 
71
- assert_raises Psych::DisallowedClass do
71
+ assert_raise Psych::DisallowedClass do
72
72
  use_ui @ui do
73
73
  @cmd.show_owners("freewill")
74
74
  end
@@ -109,7 +109,7 @@ EOF
109
109
  response = "You don't have permission to push to this gem"
110
110
  @stub_fetcher.data["#{Gem.host}/api/v1/gems/freewill/owners.yaml"] = [response, 403, 'Forbidden']
111
111
 
112
- assert_raises Gem::MockGemUi::TermError do
112
+ assert_raise Gem::MockGemUi::TermError do
113
113
  use_ui @stub_ui do
114
114
  @cmd.show_owners("freewill")
115
115
  end
@@ -155,7 +155,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
155
155
  @cmd.execute
156
156
  end
157
157
 
158
- assert_path_exists gem_exec
158
+ assert_path_exist gem_exec
159
159
 
160
160
  ruby_exec = sprintf Gem.default_exec_format, 'ruby'
161
161
 
@@ -356,10 +356,10 @@ class TestGemCommandsPristineCommand < Gem::TestCase
356
356
  assert_equal "Restored #{b.full_name}", out.shift
357
357
  assert_empty out, out.inspect
358
358
 
359
- assert_path_exists File.join(@gemhome, "gems", 'a-2')
360
- refute_path_exists File.join(gemhome2, "gems", 'a-2')
361
- assert_path_exists File.join(gemhome2, "gems", 'b-2')
362
- refute_path_exists File.join(@gemhome, "gems", 'b-2')
359
+ assert_path_exist File.join(@gemhome, "gems", 'a-2')
360
+ assert_path_not_exist File.join(gemhome2, "gems", 'a-2')
361
+ assert_path_exist File.join(gemhome2, "gems", 'b-2')
362
+ assert_path_not_exist File.join(@gemhome, "gems", 'b-2')
363
363
  end
364
364
 
365
365
  def test_execute_missing_cache_gem
@@ -434,21 +434,21 @@ class TestGemCommandsPristineCommand < Gem::TestCase
434
434
  assert_empty out, out.inspect
435
435
  assert_empty @ui.error
436
436
 
437
- assert_path_exists File.join(@gemhome, "cache", 'a-1.gem')
438
- refute_path_exists File.join(gemhome2, "cache", 'a-2.gem')
439
- assert_path_exists File.join(@gemhome, "gems", 'a-1')
440
- refute_path_exists File.join(gemhome2, "gems", 'a-1')
437
+ assert_path_exist File.join(@gemhome, "cache", 'a-1.gem')
438
+ assert_path_not_exist File.join(gemhome2, "cache", 'a-2.gem')
439
+ assert_path_exist File.join(@gemhome, "gems", 'a-1')
440
+ assert_path_not_exist File.join(gemhome2, "gems", 'a-1')
441
441
 
442
- assert_path_exists File.join(gemhome2, "cache", 'b-1.gem')
443
- refute_path_exists File.join(@gemhome, "cache", 'b-2.gem')
444
- assert_path_exists File.join(gemhome2, "gems", 'b-1')
445
- refute_path_exists File.join(@gemhome, "gems", 'b-1')
442
+ assert_path_exist File.join(gemhome2, "cache", 'b-1.gem')
443
+ assert_path_not_exist File.join(@gemhome, "cache", 'b-2.gem')
444
+ assert_path_exist File.join(gemhome2, "gems", 'b-1')
445
+ assert_path_not_exist File.join(@gemhome, "gems", 'b-1')
446
446
  end
447
447
 
448
448
  def test_execute_no_gem
449
449
  @cmd.options[:args] = %w[]
450
450
 
451
- e = assert_raises Gem::CommandLineError do
451
+ e = assert_raise Gem::CommandLineError do
452
452
  use_ui @ui do
453
453
  @cmd.execute
454
454
  end
@@ -123,7 +123,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
123
123
  Gem.configuration.disable_default_gem_server = true
124
124
  response = "You must specify a gem server"
125
125
 
126
- assert_raises Gem::MockGemUi::TermError do
126
+ assert_raise Gem::MockGemUi::TermError do
127
127
  use_ui @ui do
128
128
  @cmd.send_gem(@path)
129
129
  end
@@ -155,7 +155,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
155
155
  @host => @api_key,
156
156
  }
157
157
 
158
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
159
158
  File.open Gem.configuration.credentials_path, 'w' do |f|
160
159
  f.write keys.to_yaml
161
160
  end
@@ -190,7 +189,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
190
189
  @host => @api_key,
191
190
  }
192
191
 
193
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
194
192
  File.open Gem.configuration.credentials_path, 'w' do |f|
195
193
  f.write keys.to_yaml
196
194
  end
@@ -232,7 +230,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
232
230
  :rubygems_api_key => @api_key,
233
231
  }
234
232
 
235
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
236
233
  File.open Gem.configuration.credentials_path, 'w' do |f|
237
234
  f.write keys.to_yaml
238
235
  end
@@ -252,7 +249,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
252
249
 
253
250
  response = %(ERROR: "#{@host}" is not allowed by the gemspec, which only allows "https://privategemserver.example")
254
251
 
255
- assert_raises Gem::MockGemUi::TermError do
252
+ assert_raise Gem::MockGemUi::TermError do
256
253
  send_battery
257
254
  end
258
255
 
@@ -274,7 +271,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
274
271
  @host => @api_key,
275
272
  }
276
273
 
277
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
278
274
  File.open Gem.configuration.credentials_path, 'w' do |f|
279
275
  f.write keys.to_yaml
280
276
  end
@@ -284,7 +280,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
284
280
 
285
281
  response = "ERROR: \"#{@host}\" is not allowed by the gemspec, which only allows \"#{push_host}\""
286
282
 
287
- assert_raises Gem::MockGemUi::TermError do
283
+ assert_raise Gem::MockGemUi::TermError do
288
284
  send_battery
289
285
  end
290
286
 
@@ -305,7 +301,6 @@ class TestGemCommandsPushCommand < Gem::TestCase
305
301
  host => api_key,
306
302
  }
307
303
 
308
- FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
309
304
  File.open Gem.configuration.credentials_path, 'w' do |f|
310
305
  f.write keys.to_yaml
311
306
  end
@@ -332,7 +327,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
332
327
 
333
328
  def test_raises_error_with_no_arguments
334
329
  def @cmd.sign_in(*); end
335
- assert_raises Gem::CommandLineError do
330
+ assert_raise Gem::CommandLineError do
336
331
  @cmd.execute
337
332
  end
338
333
  end
@@ -342,7 +337,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
342
337
  @fetcher.data["#{@host}/api/v1/gems"] = [response, 403, 'Forbidden']
343
338
  @cmd.instance_variable_set :@host, @host
344
339
 
345
- assert_raises Gem::MockGemUi::TermError do
340
+ assert_raise Gem::MockGemUi::TermError do
346
341
  use_ui @ui do
347
342
  @cmd.send_gem(@path)
348
343
  end
@@ -392,7 +387,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
392
387
  @fetcher.data["#{Gem.host}/api/v1/gems"] = [response, 401, 'Unauthorized']
393
388
 
394
389
  @otp_ui = Gem::MockGemUi.new "111111\n"
395
- assert_raises Gem::MockGemUi::TermError do
390
+ assert_raise Gem::MockGemUi::TermError do
396
391
  use_ui @otp_ui do
397
392
  @cmd.send_gem(@path)
398
393
  end
@@ -213,7 +213,7 @@ pl (1)
213
213
  def test_execute_installed
214
214
  @cmd.handle_options %w[-n a --installed]
215
215
 
216
- assert_raises Gem::MockGemUi::SystemExitException do
216
+ assert_raise Gem::MockGemUi::SystemExitException do
217
217
  use_ui @stub_ui do
218
218
  @cmd.execute
219
219
  end
@@ -226,7 +226,7 @@ pl (1)
226
226
  def test_execute_installed_inverse
227
227
  @cmd.handle_options %w[-n a --no-installed]
228
228
 
229
- e = assert_raises Gem::MockGemUi::TermError do
229
+ e = assert_raise Gem::MockGemUi::TermError do
230
230
  use_ui @stub_ui do
231
231
  @cmd.execute
232
232
  end
@@ -241,7 +241,7 @@ pl (1)
241
241
  def test_execute_installed_inverse_not_installed
242
242
  @cmd.handle_options %w[-n not_installed --no-installed]
243
243
 
244
- assert_raises Gem::MockGemUi::SystemExitException do
244
+ assert_raise Gem::MockGemUi::SystemExitException do
245
245
  use_ui @stub_ui do
246
246
  @cmd.execute
247
247
  end
@@ -254,7 +254,7 @@ pl (1)
254
254
  def test_execute_installed_no_name
255
255
  @cmd.handle_options %w[--installed]
256
256
 
257
- e = assert_raises Gem::MockGemUi::TermError do
257
+ e = assert_raise Gem::MockGemUi::TermError do
258
258
  use_ui @stub_ui do
259
259
  @cmd.execute
260
260
  end
@@ -269,7 +269,7 @@ pl (1)
269
269
  def test_execute_installed_not_installed
270
270
  @cmd.handle_options %w[-n not_installed --installed]
271
271
 
272
- e = assert_raises Gem::MockGemUi::TermError do
272
+ e = assert_raise Gem::MockGemUi::TermError do
273
273
  use_ui @stub_ui do
274
274
  @cmd.execute
275
275
  end
@@ -284,7 +284,7 @@ pl (1)
284
284
  def test_execute_installed_version
285
285
  @cmd.handle_options %w[-n a --installed --version 2]
286
286
 
287
- assert_raises Gem::MockGemUi::SystemExitException do
287
+ assert_raise Gem::MockGemUi::SystemExitException do
288
288
  use_ui @stub_ui do
289
289
  @cmd.execute
290
290
  end
@@ -297,7 +297,7 @@ pl (1)
297
297
  def test_execute_installed_version_not_installed
298
298
  @cmd.handle_options %w[-n c --installed --version 2]
299
299
 
300
- e = assert_raises Gem::MockGemUi::TermError do
300
+ e = assert_raise Gem::MockGemUi::TermError do
301
301
  use_ui @stub_ui do
302
302
  @cmd.execute
303
303
  end
@@ -44,14 +44,14 @@ class TestGemCommandsServerCommand < Gem::TestCase
44
44
  # for container environment on GitHub Actions
45
45
  end
46
46
 
47
- e = assert_raises OptionParser::InvalidArgument do
47
+ e = assert_raise OptionParser::InvalidArgument do
48
48
  @cmd.send :handle_options, %w[-p nonexistent]
49
49
  end
50
50
 
51
51
  assert_equal 'invalid argument: -p nonexistent: no such named service',
52
52
  e.message
53
53
 
54
- e = assert_raises OptionParser::InvalidArgument do
54
+ e = assert_raise OptionParser::InvalidArgument do
55
55
  @cmd.send :handle_options, %w[-p 65536]
56
56
  end
57
57
 
@@ -169,14 +169,14 @@ class TestGemCommandsSetupCommand < Gem::TestCase
169
169
  Dir.mktmpdir 'lib' do |dir|
170
170
  @cmd.install_lib dir
171
171
 
172
- assert_path_exists File.join(dir, 'rubygems.rb')
173
- assert_path_exists File.join(dir, 'rubygems/ssl_certs/rubygems.org/foo.pem')
172
+ assert_path_exist File.join(dir, 'rubygems.rb')
173
+ assert_path_exist File.join(dir, 'rubygems/ssl_certs/rubygems.org/foo.pem')
174
174
 
175
- assert_path_exists File.join(dir, 'bundler.rb')
176
- assert_path_exists File.join(dir, 'bundler/b.rb')
175
+ assert_path_exist File.join(dir, 'bundler.rb')
176
+ assert_path_exist File.join(dir, 'bundler/b.rb')
177
177
 
178
- assert_path_exists File.join(dir, 'bundler/templates/.circleci/config.yml') unless RUBY_ENGINE == "truffleruby" # https://github.com/oracle/truffleruby/issues/2116
179
- assert_path_exists File.join(dir, 'bundler/templates/.travis.yml')
178
+ assert_path_exist File.join(dir, 'bundler/templates/.circleci/config.yml')
179
+ assert_path_exist File.join(dir, 'bundler/templates/.travis.yml')
180
180
  end
181
181
  end
182
182
 
@@ -192,27 +192,27 @@ class TestGemCommandsSetupCommand < Gem::TestCase
192
192
 
193
193
  spec.executables.each do |e|
194
194
  if Gem.win_platform?
195
- assert_path_exists File.join(bin_dir, "#{e}.bat")
195
+ assert_path_exist File.join(bin_dir, "#{e}.bat")
196
196
  end
197
197
 
198
- assert_path_exists File.join bin_dir, e
198
+ assert_path_exist File.join bin_dir, e
199
199
  end
200
200
 
201
201
  default_dir = Gem.default_specifications_dir
202
202
 
203
203
  # expect to remove other versions of bundler gemspecs on default specification directory.
204
- refute_path_exists File.join(default_dir, "bundler-1.15.4.gemspec")
205
- assert_path_exists File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec")
204
+ assert_path_not_exist File.join(default_dir, "bundler-1.15.4.gemspec")
205
+ assert_path_exist File.join(default_dir, "bundler-#{BUNDLER_VERS}.gemspec")
206
206
 
207
207
  # expect to not remove bundler-* gemspecs.
208
- assert_path_exists File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
208
+ assert_path_exist File.join(Gem.dir, "specifications", "bundler-audit-1.0.0.gemspec")
209
209
 
210
210
  # expect to remove normal gem that was same version. because it's promoted default gems.
211
- refute_path_exists File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
211
+ assert_path_not_exist File.join(Gem.dir, "specifications", "bundler-#{BUNDLER_VERS}.gemspec")
212
212
 
213
- assert_path_exists "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
214
- assert_path_exists "#{Gem.dir}/gems/bundler-1.15.4"
215
- assert_path_exists "#{Gem.dir}/gems/bundler-audit-1.0.0"
213
+ assert_path_exist "#{Gem.dir}/gems/bundler-#{BUNDLER_VERS}"
214
+ assert_path_exist "#{Gem.dir}/gems/bundler-1.15.4"
215
+ assert_path_exist "#{Gem.dir}/gems/bundler-audit-1.0.0"
216
216
  end
217
217
 
218
218
  def test_install_default_bundler_gem_with_force_flag
@@ -238,10 +238,10 @@ class TestGemCommandsSetupCommand < Gem::TestCase
238
238
 
239
239
  spec.executables.each do |e|
240
240
  if Gem.win_platform?
241
- assert_path_exists File.join(bin_dir, "#{e}.bat")
241
+ assert_path_exist File.join(bin_dir, "#{e}.bat")
242
242
  end
243
243
 
244
- assert_path_exists File.join bin_dir, e
244
+ assert_path_exist File.join bin_dir, e
245
245
  end
246
246
  end
247
247
  end
@@ -272,9 +272,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
272
272
 
273
273
  @cmd.remove_old_lib_files lib
274
274
 
275
- files_that_go.each {|file| refute_path_exists(file) unless file == old_bundler_ci && RUBY_ENGINE == "truffleruby" } # https://github.com/oracle/truffleruby/issues/2116
275
+ files_that_go.each {|file| assert_path_not_exist(file) unless file == old_bundler_ci }
276
276
 
277
- files_that_stay.each {|file| assert_path_exists file }
277
+ files_that_stay.each {|file| assert_path_exist file }
278
278
  end
279
279
 
280
280
  def test_remove_old_man_files
@@ -295,9 +295,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
295
295
 
296
296
  @cmd.remove_old_man_files man
297
297
 
298
- files_that_go.each {|file| refute_path_exists file }
298
+ files_that_go.each {|file| assert_path_not_exist file }
299
299
 
300
- files_that_stay.each {|file| assert_path_exists file }
300
+ files_that_stay.each {|file| assert_path_exist file }
301
301
  end
302
302
 
303
303
  def test_show_release_notes
@@ -26,14 +26,21 @@ class TestGemCommandsSigninCommand < Gem::TestCase
26
26
  assert_match %r{Signed in.}, sign_in_ui.output
27
27
  end
28
28
 
29
+ def test_execute_when_not_already_signed_in_and_not_preexisting_credentials_folder
30
+ FileUtils.rm Gem.configuration.credentials_path
31
+
32
+ sign_in_ui = util_capture { @cmd.execute }
33
+ assert_match %r{Signed in.}, sign_in_ui.output
34
+ end
35
+
29
36
  def test_execute_when_already_signed_in_with_same_host
30
37
  host = 'http://some-gemcutter-compatible-host.org'
31
38
 
32
39
  util_capture(nil, host) { @cmd.execute }
33
- old_credentials = YAML.load_file Gem.configuration.credentials_path
40
+ old_credentials = load_yaml_file Gem.configuration.credentials_path
34
41
 
35
42
  util_capture(nil, host) { @cmd.execute }
36
- new_credentials = YAML.load_file Gem.configuration.credentials_path
43
+ new_credentials = load_yaml_file Gem.configuration.credentials_path
37
44
 
38
45
  assert_equal old_credentials[host], new_credentials[host]
39
46
  end
@@ -45,7 +52,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
45
52
  host = 'http://some-gemcutter-compatible-host.org'
46
53
 
47
54
  util_capture(nil, host, api_key) { @cmd.execute }
48
- credentials = YAML.load_file Gem.configuration.credentials_path
55
+ credentials = load_yaml_file Gem.configuration.credentials_path
49
56
 
50
57
  assert_equal credentials[:rubygems_api_key], api_key
51
58
 
@@ -60,7 +67,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
60
67
  assert_match %r{Signed in.}, sign_in_ui.output
61
68
 
62
69
  api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
63
- credentials = YAML.load_file Gem.configuration.credentials_path
70
+ credentials = load_yaml_file Gem.configuration.credentials_path
64
71
  assert_equal api_key, credentials[host]
65
72
  end
66
73
 
@@ -68,7 +75,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
68
75
  util_capture { @cmd.execute }
69
76
 
70
77
  api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
71
- credentials = YAML.load_file Gem.configuration.credentials_path
78
+ credentials = load_yaml_file Gem.configuration.credentials_path
72
79
 
73
80
  assert_equal api_key, credentials[:rubygems_api_key]
74
81
  end
@@ -94,7 +101,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
94
101
  assert_match "show_dashboard [y/N]", key_name_ui.output
95
102
  assert_equal "name=test-key&push_rubygem=true", fetcher.last_request.body
96
103
 
97
- credentials = YAML.load_file Gem.configuration.credentials_path
104
+ credentials = load_yaml_file Gem.configuration.credentials_path
98
105
  assert_equal api_key, credentials[:rubygems_api_key]
99
106
  end
100
107