rubygems-update 3.2.17 → 3.2.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Manifest.txt +2 -0
  4. data/Rakefile +1 -6
  5. data/bundler/CHANGELOG.md +16 -0
  6. data/bundler/bundler.gemspec +2 -3
  7. data/bundler/lib/bundler.rb +1 -0
  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/outdated.rb +7 -10
  11. data/bundler/lib/bundler/definition.rb +14 -75
  12. data/bundler/lib/bundler/feature_flag.rb +0 -1
  13. data/bundler/lib/bundler/friendly_errors.rb +1 -1
  14. data/bundler/lib/bundler/index.rb +1 -2
  15. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  16. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  17. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  18. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  20. data/bundler/lib/bundler/man/bundle-config.1 +1 -7
  21. data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -8
  22. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle.1 +1 -1
  40. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  41. data/bundler/lib/bundler/plugin/api/source.rb +14 -0
  42. data/bundler/lib/bundler/resolver.rb +13 -96
  43. data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
  44. data/bundler/lib/bundler/rubygems_ext.rb +2 -2
  45. data/bundler/lib/bundler/settings.rb +0 -1
  46. data/bundler/lib/bundler/source.rb +9 -0
  47. data/bundler/lib/bundler/source/rubygems.rb +15 -4
  48. data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
  49. data/bundler/lib/bundler/source_list.rb +29 -10
  50. data/bundler/lib/bundler/source_map.rb +58 -0
  51. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  52. data/bundler/lib/bundler/version.rb +1 -1
  53. data/lib/rubygems.rb +1 -1
  54. data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
  55. data/lib/rubygems/specification.rb +0 -2
  56. data/lib/rubygems/test_case.rb +102 -18
  57. data/rubygems-update.gemspec +1 -1
  58. data/test/rubygems/test_bundled_ca.rb +2 -2
  59. data/test/rubygems/test_deprecate.rb +3 -3
  60. data/test/rubygems/test_gem.rb +33 -31
  61. data/test/rubygems/test_gem_bundler_version_finder.rb +2 -2
  62. data/test/rubygems/test_gem_command.rb +1 -1
  63. data/test/rubygems/test_gem_command_manager.rb +5 -5
  64. data/test/rubygems/test_gem_commands_build_command.rb +10 -10
  65. data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
  66. data/test/rubygems/test_gem_commands_check_command.rb +5 -5
  67. data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
  68. data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
  69. data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
  70. data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
  71. data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
  72. data/test/rubygems/test_gem_commands_help_command.rb +1 -1
  73. data/test/rubygems/test_gem_commands_install_command.rb +60 -60
  74. data/test/rubygems/test_gem_commands_list_command.rb +1 -1
  75. data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
  76. data/test/rubygems/test_gem_commands_open_command.rb +8 -9
  77. data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
  78. data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
  79. data/test/rubygems/test_gem_commands_push_command.rb +6 -6
  80. data/test/rubygems/test_gem_commands_query_command.rb +7 -7
  81. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  82. data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
  83. data/test/rubygems/test_gem_commands_signin_command.rb +6 -6
  84. data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
  85. data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
  86. data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
  87. data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
  88. data/test/rubygems/test_gem_commands_update_command.rb +10 -10
  89. data/test/rubygems/test_gem_commands_which_command.rb +3 -3
  90. data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
  91. data/test/rubygems/test_gem_config_file.rb +9 -9
  92. data/test/rubygems/test_gem_dependency.rb +6 -6
  93. data/test/rubygems/test_gem_dependency_installer.rb +4 -4
  94. data/test/rubygems/test_gem_doctor.rb +30 -30
  95. data/test/rubygems/test_gem_ext_builder.rb +20 -20
  96. data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
  97. data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
  98. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
  99. data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
  100. data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -8
  101. data/test/rubygems/test_gem_install_update_options.rb +9 -9
  102. data/test/rubygems/test_gem_installer.rb +142 -140
  103. data/test/rubygems/test_gem_local_remote_options.rb +1 -1
  104. data/test/rubygems/test_gem_package.rb +48 -48
  105. data/test/rubygems/test_gem_package_old.rb +9 -9
  106. data/test/rubygems/test_gem_package_tar_header.rb +5 -5
  107. data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
  108. data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
  109. data/test/rubygems/test_gem_package_task.rb +2 -2
  110. data/test/rubygems/test_gem_path_support.rb +1 -1
  111. data/test/rubygems/test_gem_rdoc.rb +9 -9
  112. data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
  113. data/test/rubygems/test_gem_request.rb +2 -2
  114. data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
  115. data/test/rubygems/test_gem_request_set.rb +15 -14
  116. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
  117. data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
  118. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
  119. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
  120. data/test/rubygems/test_gem_requirement.rb +13 -13
  121. data/test/rubygems/test_gem_resolver.rb +11 -11
  122. data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
  123. data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
  124. data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
  125. data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
  126. data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
  127. data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
  128. data/test/rubygems/test_gem_resolver_specification.rb +1 -1
  129. data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
  130. data/test/rubygems/test_gem_security.rb +5 -5
  131. data/test/rubygems/test_gem_security_policy.rb +27 -27
  132. data/test/rubygems/test_gem_security_signer.rb +7 -7
  133. data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
  134. data/test/rubygems/test_gem_server.rb +2 -2
  135. data/test/rubygems/test_gem_silent_ui.rb +9 -9
  136. data/test/rubygems/test_gem_source.rb +2 -2
  137. data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
  138. data/test/rubygems/test_gem_source_git.rb +11 -11
  139. data/test/rubygems/test_gem_source_specific_file.rb +1 -1
  140. data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
  141. data/test/rubygems/test_gem_specification.rb +83 -103
  142. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  143. data/test/rubygems/test_gem_stub_specification.rb +4 -4
  144. data/test/rubygems/test_gem_uninstaller.rb +16 -16
  145. data/test/rubygems/test_gem_util.rb +8 -6
  146. data/test/rubygems/test_gem_version.rb +4 -13
  147. data/test/rubygems/test_kernel.rb +4 -4
  148. data/test/rubygems/test_project_sanity.rb +1 -1
  149. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  150. data/test/rubygems/test_require.rb +13 -13
  151. data/test/test_changelog_generator.rb +1 -2
  152. metadata +5 -3
@@ -132,12 +132,12 @@ install:
132
132
  @builder.build_extensions
133
133
  end
134
134
 
135
- assert_path_exists @spec.extension_dir
136
- assert_path_exists @spec.gem_build_complete_path
137
- assert_path_exists File.join @spec.extension_dir, 'gem_make.out'
138
- assert_path_exists File.join @spec.extension_dir, 'a.rb'
139
- assert_path_exists File.join @spec.gem_dir, 'lib', 'a.rb'
140
- assert_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
135
+ assert_path_exist @spec.extension_dir
136
+ assert_path_exist @spec.gem_build_complete_path
137
+ assert_path_exist File.join @spec.extension_dir, 'gem_make.out'
138
+ assert_path_exist File.join @spec.extension_dir, 'a.rb'
139
+ assert_path_exist File.join @spec.gem_dir, 'lib', 'a.rb'
140
+ assert_path_exist File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
141
141
  end
142
142
 
143
143
  def test_build_extensions_with_gemhome_with_space
@@ -188,12 +188,12 @@ install:
188
188
  @builder.build_extensions
189
189
  end
190
190
 
191
- assert_path_exists @spec.extension_dir
192
- assert_path_exists @spec.gem_build_complete_path
193
- assert_path_exists File.join @spec.extension_dir, 'gem_make.out'
194
- assert_path_exists File.join @spec.extension_dir, 'a.rb'
195
- refute_path_exists File.join @spec.gem_dir, 'lib', 'a.rb'
196
- refute_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
191
+ assert_path_exist @spec.extension_dir
192
+ assert_path_exist @spec.gem_build_complete_path
193
+ assert_path_exist File.join @spec.extension_dir, 'gem_make.out'
194
+ assert_path_exist File.join @spec.extension_dir, 'a.rb'
195
+ assert_path_not_exist File.join @spec.gem_dir, 'lib', 'a.rb'
196
+ assert_path_not_exist File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
197
197
  ensure
198
198
  class << Gem
199
199
  remove_method :install_extension_in_lib
@@ -210,7 +210,7 @@ install:
210
210
  assert_equal '', @ui.output
211
211
  assert_equal '', @ui.error
212
212
 
213
- refute_path_exists File.join @spec.extension_dir, 'gem_make.out'
213
+ assert_path_not_exist File.join @spec.extension_dir, 'gem_make.out'
214
214
  end
215
215
 
216
216
  def test_build_extensions_rebuild_failure
@@ -219,13 +219,13 @@ install:
219
219
 
220
220
  @spec.extensions << nil
221
221
 
222
- assert_raises Gem::Ext::BuildError do
222
+ assert_raise Gem::Ext::BuildError do
223
223
  use_ui @ui do
224
224
  @builder.build_extensions
225
225
  end
226
226
  end
227
227
 
228
- refute_path_exists @spec.gem_build_complete_path
228
+ assert_path_not_exist @spec.gem_build_complete_path
229
229
  end
230
230
 
231
231
  def test_build_extensions_extconf_bad
@@ -235,7 +235,7 @@ install:
235
235
 
236
236
  FileUtils.mkdir_p @spec.gem_dir
237
237
 
238
- e = assert_raises Gem::Ext::BuildError do
238
+ e = assert_raise Gem::Ext::BuildError do
239
239
  use_ui @ui do
240
240
  @builder.build_extensions
241
241
  end
@@ -251,7 +251,7 @@ install:
251
251
  assert_match %r{#{Regexp.escape Gem.ruby} .* extconf\.rb}, cmd_make_out
252
252
  assert_match %r{: No such file}, cmd_make_out
253
253
 
254
- refute_path_exists @spec.gem_build_complete_path
254
+ assert_path_not_exist @spec.gem_build_complete_path
255
255
 
256
256
  assert_equal cwd, Dir.pwd
257
257
  end
@@ -261,7 +261,7 @@ install:
261
261
  gem_make_out = File.join @spec.extension_dir, 'gem_make.out'
262
262
  @spec.extensions << nil
263
263
 
264
- e = assert_raises Gem::Ext::BuildError do
264
+ e = assert_raise Gem::Ext::BuildError do
265
265
  use_ui @ui do
266
266
  @builder.build_extensions
267
267
  end
@@ -273,7 +273,7 @@ install:
273
273
 
274
274
  assert_equal "No builder for extension ''\n", File.read(gem_make_out)
275
275
 
276
- refute_path_exists @spec.gem_build_complete_path
276
+ assert_path_not_exist @spec.gem_build_complete_path
277
277
  ensure
278
278
  FileUtils.rm_f gem_make_out
279
279
  end
@@ -308,7 +308,7 @@ install:
308
308
  path = File.join @spec.gem_dir, "extconf_args"
309
309
 
310
310
  assert_equal args.inspect, File.read(path).strip
311
- assert_path_exists @spec.extension_dir
311
+ assert_path_exist @spec.extension_dir
312
312
  end
313
313
 
314
314
  def test_initialize
@@ -7,13 +7,13 @@ class TestGemExtCmakeBuilder < Gem::TestCase
7
7
  super
8
8
 
9
9
  # Details: https://github.com/rubygems/rubygems/issues/1270#issuecomment-177368340
10
- skip "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
10
+ pend "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
11
11
 
12
12
  begin
13
13
  _, status = Open3.capture2e('cmake')
14
- skip 'cmake not present' unless status.success?
14
+ pend 'cmake not present' unless status.success?
15
15
  rescue Errno::ENOENT
16
- skip 'cmake not present'
16
+ pend 'cmake not present'
17
17
  end
18
18
 
19
19
  @ext = File.join @tempdir, 'ext'
@@ -50,7 +50,7 @@ install (FILES test.txt DESTINATION bin)
50
50
  def test_self_build_fail
51
51
  output = []
52
52
 
53
- error = assert_raises Gem::InstallError do
53
+ error = assert_raise Gem::InstallError do
54
54
  Gem::Ext::CmakeBuilder.build nil, @dest_path, output, [], nil, @ext
55
55
  end
56
56
 
@@ -17,7 +17,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
17
17
  end
18
18
 
19
19
  def test_self_build
20
- skip("test_self_build skipped on MS Windows (VC++)") if vc_windows?
20
+ pend("test_self_build skipped on MS Windows (VC++)") if vc_windows?
21
21
 
22
22
  File.open File.join(@ext, './configure'), 'w' do |configure|
23
23
  configure.puts "#!/bin/sh\necho \"#{@makefile_body}\" > Makefile"
@@ -42,10 +42,10 @@ class TestGemExtConfigureBuilder < Gem::TestCase
42
42
  end
43
43
 
44
44
  def test_self_build_fail
45
- skip("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
45
+ pend("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
46
46
  output = []
47
47
 
48
- error = assert_raises Gem::InstallError do
48
+ error = assert_raise Gem::InstallError do
49
49
  Gem::Ext::ConfigureBuilder.build nil, @dest_path, output, [], nil, @ext
50
50
  end
51
51
 
@@ -62,7 +62,7 @@ class TestGemExtConfigureBuilder < Gem::TestCase
62
62
 
63
63
  def test_self_build_has_makefile
64
64
  if vc_windows? && !nmake_found?
65
- skip("test_self_build_has_makefile skipped - nmake not found")
65
+ pend("test_self_build_has_makefile skipped - nmake not found")
66
66
  end
67
67
 
68
68
  File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
@@ -16,11 +16,11 @@ class TestGemExtExtConfBuilder < Gem::TestCase
16
16
 
17
17
  def test_class_build
18
18
  if java_platform?
19
- skip("failing on jruby")
19
+ pend("failing on jruby")
20
20
  end
21
21
 
22
22
  if vc_windows? && !nmake_found?
23
- skip("test_class_build skipped - nmake not found")
23
+ pend("test_class_build skipped - nmake not found")
24
24
  end
25
25
 
26
26
  File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -41,11 +41,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
41
41
  assert_contains_make_command '', output[7]
42
42
  assert_contains_make_command 'install', output[10]
43
43
  assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
44
+ assert_empty Dir.glob(File.join(@ext, '.gem.*'))
44
45
  end
45
46
 
46
47
  def test_class_build_rbconfig_make_prog
47
48
  if java_platform?
48
- skip("failing on jruby")
49
+ pend("failing on jruby")
49
50
  end
50
51
 
51
52
  configure_args do
@@ -70,7 +71,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
70
71
  ENV['MAKE'] = 'anothermake'
71
72
 
72
73
  if java_platform?
73
- skip("failing on jruby")
74
+ pend("failing on jruby")
74
75
  end
75
76
 
76
77
  configure_args '' do
@@ -80,7 +81,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
80
81
 
81
82
  output = []
82
83
 
83
- assert_raises Gem::InstallError do
84
+ assert_raise Gem::InstallError do
84
85
  Gem::Ext::ExtConfBuilder.build 'extconf.rb', @dest_path, output, [], nil, @ext
85
86
  end
86
87
 
@@ -93,7 +94,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
93
94
 
94
95
  def test_class_build_extconf_fail
95
96
  if vc_windows? && !nmake_found?
96
- skip("test_class_build_extconf_fail skipped - nmake not found")
97
+ pend("test_class_build_extconf_fail skipped - nmake not found")
97
98
  end
98
99
 
99
100
  File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -104,7 +105,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
104
105
 
105
106
  output = []
106
107
 
107
- error = assert_raises Gem::InstallError do
108
+ error = assert_raise Gem::InstallError do
108
109
  Gem::Ext::ExtConfBuilder.build 'extconf.rb', @dest_path, output, [], nil, @ext
109
110
  end
110
111
 
@@ -114,12 +115,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
114
115
  assert_match(File.join(@dest_path, 'mkmf.log'), output[4])
115
116
  assert_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
116
117
 
117
- assert_path_exists File.join @dest_path, 'mkmf.log'
118
+ assert_path_exist File.join @dest_path, 'mkmf.log'
118
119
  end
119
120
 
120
121
  def test_class_build_extconf_success_without_warning
121
122
  if vc_windows? && !nmake_found?
122
- skip("test_class_build_extconf_fail skipped - nmake not found")
123
+ pend("test_class_build_extconf_fail skipped - nmake not found")
123
124
  end
124
125
 
125
126
  File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -134,12 +135,12 @@ class TestGemExtExtConfBuilder < Gem::TestCase
134
135
 
135
136
  refute_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n")
136
137
 
137
- assert_path_exists File.join @dest_path, 'mkmf.log'
138
+ assert_path_exist File.join @dest_path, 'mkmf.log'
138
139
  end
139
140
 
140
141
  def test_class_build_unconventional
141
142
  if vc_windows? && !nmake_found?
142
- skip("test_class_build skipped - nmake not found")
143
+ pend("test_class_build skipped - nmake not found")
143
144
  end
144
145
 
145
146
  File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
@@ -180,7 +181,7 @@ end
180
181
 
181
182
  def test_class_make
182
183
  if vc_windows? && !nmake_found?
183
- skip("test_class_make skipped - nmake not found")
184
+ pend("test_class_make skipped - nmake not found")
184
185
  end
185
186
 
186
187
  output = []
@@ -202,7 +203,7 @@ end
202
203
  end
203
204
 
204
205
  def test_class_make_no_Makefile
205
- error = assert_raises Gem::InstallError do
206
+ error = assert_raise Gem::InstallError do
206
207
  Gem::Ext::ExtConfBuilder.make @ext, ['output'], @ext
207
208
  end
208
209
 
@@ -90,7 +90,7 @@ class TestGemExtRakeBuilder < Gem::TestCase
90
90
  output = []
91
91
 
92
92
  build_rake_in(false) do |rake|
93
- error = assert_raises Gem::InstallError do
93
+ error = assert_raise Gem::InstallError do
94
94
  Gem::Ext::RakeBuilder.build "mkrf_conf.rb", @dest_path, output, [], nil, @ext
95
95
  end
96
96
 
@@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
101
101
  assert @fetcher.last_request["authorization"]
102
102
  assert_match %r{Signed in.}, @sign_in_ui.output
103
103
 
104
- credentials = YAML.load_file Gem.configuration.credentials_path
104
+ credentials = load_yaml_file Gem.configuration.credentials_path
105
105
  assert_equal api_key, credentials[:rubygems_api_key]
106
106
  end
107
107
 
@@ -115,7 +115,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
115
115
  assert @fetcher.last_request["authorization"]
116
116
  assert_match %r{Signed in.}, @sign_in_ui.output
117
117
 
118
- credentials = YAML.load_file Gem.configuration.credentials_path
118
+ credentials = load_yaml_file Gem.configuration.credentials_path
119
119
  assert_equal api_key, credentials['http://example.com']
120
120
  end
121
121
 
@@ -129,7 +129,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
129
129
  assert @fetcher.last_request["authorization"]
130
130
  assert_match %r{Signed in.}, @sign_in_ui.output
131
131
 
132
- credentials = YAML.load_file Gem.configuration.credentials_path
132
+ credentials = load_yaml_file Gem.configuration.credentials_path
133
133
  assert_equal api_key, credentials[:rubygems_api_key]
134
134
  end
135
135
 
@@ -142,7 +142,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
142
142
  assert @fetcher.last_request["authorization"]
143
143
  assert_match %r{Signed in.}, @sign_in_ui.output
144
144
 
145
- credentials = YAML.load_file Gem.configuration.credentials_path
145
+ credentials = load_yaml_file Gem.configuration.credentials_path
146
146
  assert_equal api_key, credentials['http://example.com']
147
147
  end
148
148
 
@@ -177,13 +177,13 @@ class TestGemGemcutterUtilities < Gem::TestCase
177
177
  assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
178
178
  assert_match %r{Signed in.}, @sign_in_ui.output
179
179
 
180
- credentials = YAML.load_file Gem.configuration.credentials_path
180
+ credentials = load_yaml_file Gem.configuration.credentials_path
181
181
  assert_equal api_key, credentials[:rubygems_api_key]
182
182
  assert_equal other_api_key, credentials[:other_api_key]
183
183
  end
184
184
 
185
185
  def test_sign_in_with_bad_credentials
186
- assert_raises Gem::MockGemUi::TermError do
186
+ assert_raise Gem::MockGemUi::TermError do
187
187
  util_sign_in ['Access Denied.', 403, 'Forbidden']
188
188
  end
189
189
 
@@ -209,7 +209,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
209
209
  def test_sign_in_with_incorrect_otp_code
210
210
  response = "You have enabled multifactor authentication but your request doesn't have the correct OTP code. Please check it and retry."
211
211
 
212
- assert_raises Gem::MockGemUi::TermError do
212
+ assert_raise Gem::MockGemUi::TermError do
213
213
  util_sign_in [response, 401, 'Unauthorized'], nil, [], "111111\n"
214
214
  end
215
215
 
@@ -257,7 +257,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
257
257
  end
258
258
 
259
259
  def test_verify_missing_api_key
260
- assert_raises Gem::MockGemUi::TermError do
260
+ assert_raise Gem::MockGemUi::TermError do
261
261
  @cmd.verify_api_key :missing
262
262
  end
263
263
  end
@@ -92,7 +92,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
92
92
  end
93
93
 
94
94
  def test_security_policy
95
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
95
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
96
96
 
97
97
  @cmd.handle_options %w[-P HighSecurity]
98
98
 
@@ -100,11 +100,11 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
100
100
  end
101
101
 
102
102
  def test_security_policy_unknown
103
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
103
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
104
104
 
105
105
  @cmd.add_install_update_options
106
106
 
107
- e = assert_raises OptionParser::InvalidArgument do
107
+ e = assert_raise OptionParser::InvalidArgument do
108
108
  @cmd.handle_options %w[-P UnknownSecurity]
109
109
  end
110
110
  assert_includes e.message, "UnknownSecurity"
@@ -124,8 +124,8 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
124
124
 
125
125
  @installer = Gem::Installer.at @gem, @cmd.options
126
126
  @installer.install
127
- assert_path_exists File.join(Gem.user_dir, 'gems')
128
- assert_path_exists File.join(Gem.user_dir, 'gems', @spec.full_name)
127
+ assert_path_exist File.join(Gem.user_dir, 'gems')
128
+ assert_path_exist File.join(Gem.user_dir, 'gems', @spec.full_name)
129
129
  end
130
130
 
131
131
  def test_user_install_disabled_read_only
@@ -137,9 +137,9 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
137
137
  @gem = @spec.cache_file
138
138
 
139
139
  if win_platform?
140
- skip('test_user_install_disabled_read_only test skipped on MS Windows')
140
+ pend('test_user_install_disabled_read_only test skipped on MS Windows')
141
141
  elsif Process.uid.zero?
142
- skip('test_user_install_disabled_read_only test skipped in root privilege')
142
+ pend('test_user_install_disabled_read_only test skipped in root privilege')
143
143
  else
144
144
  @cmd.handle_options %w[--no-user-install]
145
145
 
@@ -150,7 +150,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
150
150
 
151
151
  Gem.use_paths @gemhome, @userhome
152
152
 
153
- assert_raises(Gem::FilePermissionError) do
153
+ assert_raise(Gem::FilePermissionError) do
154
154
  Gem::Installer.at(@gem, @cmd.options).install
155
155
  end
156
156
  end
@@ -169,7 +169,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
169
169
 
170
170
  def test_vendor_missing
171
171
  vendordir(nil) do
172
- e = assert_raises OptionParser::InvalidOption do
172
+ e = assert_raise OptionParser::InvalidOption do
173
173
  @cmd.handle_options %w[--vendor]
174
174
  end
175
175
 
@@ -76,7 +76,7 @@ end
76
76
  installer.generate_bin
77
77
 
78
78
  installed_exec = File.join util_inst_bindir, 'executable'
79
- assert_path_exists installed_exec
79
+ assert_path_exist installed_exec
80
80
 
81
81
  wrapper = File.read installed_exec
82
82
  assert_match %r{generated by RubyGems}, wrapper
@@ -90,7 +90,7 @@ end
90
90
 
91
91
  ui = Gem::MockGemUi.new "n\n"
92
92
  use_ui ui do
93
- e = assert_raises Gem::InstallError do
93
+ e = assert_raise Gem::InstallError do
94
94
  installer.generate_bin
95
95
  end
96
96
 
@@ -134,7 +134,7 @@ gem 'other', version
134
134
  installer.generate_bin # should not raise
135
135
 
136
136
  installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
137
- assert_path_exists installed_exec
137
+ assert_path_exist installed_exec
138
138
 
139
139
  wrapper = File.read installed_exec
140
140
  assert_match %r{generated by RubyGems}, wrapper
@@ -150,7 +150,7 @@ gem 'other', version
150
150
  ui = Gem::MockGemUi.new "n\n"
151
151
 
152
152
  use_ui ui do
153
- e = assert_raises Gem::InstallError do
153
+ e = assert_raise Gem::InstallError do
154
154
  installer.generate_bin
155
155
  end
156
156
 
@@ -169,7 +169,7 @@ gem 'other', version
169
169
  installer.generate_bin
170
170
 
171
171
  installed_exec = File.join util_inst_bindir, 'executable'
172
- assert_path_exists installed_exec
172
+ assert_path_exist installed_exec
173
173
 
174
174
  wrapper = File.read installed_exec
175
175
  assert_match %r{generated by RubyGems}, wrapper
@@ -184,7 +184,7 @@ gem 'other', version
184
184
  installer.generate_bin
185
185
 
186
186
  installed_exec = File.join util_inst_bindir, 'executable'
187
- assert_path_exists installed_exec
187
+ assert_path_exist installed_exec
188
188
 
189
189
  wrapper = File.read installed_exec
190
190
  assert_match %r{generated by RubyGems}, wrapper
@@ -222,7 +222,7 @@ gem 'other', version
222
222
  end
223
223
 
224
224
  def test_check_that_user_bin_dir_is_in_path_tilde
225
- skip "Tilde is PATH is not supported under MS Windows" if win_platform?
225
+ pend "Tilde is PATH is not supported under MS Windows" if win_platform?
226
226
 
227
227
  orig_PATH, ENV['PATH'] =
228
228
  ENV['PATH'], [ENV['PATH'], '~/bin'].join(File::PATH_SEPARATOR)
@@ -264,7 +264,7 @@ gem 'other', version
264
264
  assert installer.ensure_dependency(@spec, dep)
265
265
 
266
266
  dep = Gem::Dependency.new 'b', '> 2'
267
- e = assert_raises Gem::InstallError do
267
+ e = assert_raise Gem::InstallError do
268
268
  installer.ensure_dependency @spec, dep
269
269
  end
270
270
 
@@ -278,7 +278,7 @@ gem 'other', version
278
278
 
279
279
  installer = Gem::Installer.at a_gem
280
280
 
281
- e = assert_raises Gem::InstallError do
281
+ e = assert_raise Gem::InstallError do
282
282
  installer.ensure_loadable_spec
283
283
  end
284
284
 
@@ -287,7 +287,7 @@ gem 'other', version
287
287
  end
288
288
 
289
289
  def test_ensure_loadable_spec_security_policy
290
- skip 'openssl is missing' unless Gem::HAVE_OPENSSL
290
+ pend 'openssl is missing' unless Gem::HAVE_OPENSSL
291
291
 
292
292
  _, a_gem = util_gem 'a', 2 do |s|
293
293
  s.add_dependency 'garbage ~> 5'
@@ -296,7 +296,7 @@ gem 'other', version
296
296
  policy = Gem::Security::HighSecurity
297
297
  installer = Gem::Installer.at a_gem, :security_policy => policy
298
298
 
299
- assert_raises Gem::Security::Exception do
299
+ assert_raise Gem::Security::Exception do
300
300
  installer.ensure_loadable_spec
301
301
  end
302
302
  end
@@ -306,7 +306,7 @@ gem 'other', version
306
306
 
307
307
  installer.extract_files
308
308
 
309
- assert_path_exists File.join @spec.gem_dir, 'bin/executable'
309
+ assert_path_exist File.join @spec.gem_dir, 'bin/executable'
310
310
  end
311
311
 
312
312
  def test_generate_bin_bindir
@@ -329,7 +329,7 @@ gem 'other', version
329
329
 
330
330
  assert_directory_exists util_inst_bindir
331
331
  installed_exec = File.join(util_inst_bindir, 'executable')
332
- assert_path_exists installed_exec
332
+ assert_path_exist installed_exec
333
333
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
334
334
 
335
335
  wrapper = File.read installed_exec
@@ -372,7 +372,7 @@ gem 'other', version
372
372
  installer.generate_bin
373
373
  assert_directory_exists util_inst_bindir
374
374
  installed_exec = File.join util_inst_bindir, 'executable'
375
- assert_path_exists installed_exec
375
+ assert_path_exist installed_exec
376
376
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
377
377
 
378
378
  wrapper = File.read installed_exec
@@ -391,7 +391,7 @@ gem 'other', version
391
391
  installer.generate_bin
392
392
  assert_directory_exists util_inst_bindir
393
393
  installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
394
- assert_path_exists installed_exec
394
+ assert_path_exist installed_exec
395
395
  ensure
396
396
  Gem::Installer.exec_format = nil
397
397
  end
@@ -407,7 +407,7 @@ gem 'other', version
407
407
  installer.generate_bin
408
408
  assert_directory_exists util_inst_bindir
409
409
  installed_exec = File.join util_inst_bindir, 'executable'
410
- assert_path_exists installed_exec
410
+ assert_path_exist installed_exec
411
411
  ensure
412
412
  Gem::Installer.exec_format = nil
413
413
  end
@@ -431,7 +431,7 @@ gem 'other', version
431
431
  installer.generate_bin
432
432
 
433
433
  installed_exec = File.join("#{@gemhome}2", "bin", 'executable')
434
- assert_path_exists installed_exec
434
+ assert_path_exist installed_exec
435
435
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
436
436
 
437
437
  wrapper = File.read installed_exec
@@ -446,7 +446,7 @@ gem 'other', version
446
446
  installer.wrappers = true
447
447
  installer.generate_bin
448
448
 
449
- refute_path_exists util_inst_bindir, 'bin dir was created when not needed'
449
+ assert_path_not_exist util_inst_bindir, 'bin dir was created when not needed'
450
450
  end
451
451
 
452
452
  def test_generate_bin_script_no_perms
@@ -458,13 +458,13 @@ gem 'other', version
458
458
  Dir.mkdir util_inst_bindir
459
459
 
460
460
  if win_platform?
461
- skip('test_generate_bin_script_no_perms skipped on MS Windows')
461
+ pend('test_generate_bin_script_no_perms skipped on MS Windows')
462
462
  elsif Process.uid.zero?
463
- skip('test_generate_bin_script_no_perms skipped in root privilege')
463
+ pend('test_generate_bin_script_no_perms skipped in root privilege')
464
464
  else
465
465
  FileUtils.chmod 0000, util_inst_bindir
466
466
 
467
- assert_raises Gem::FilePermissionError do
467
+ assert_raise Gem::FilePermissionError do
468
468
  installer.generate_bin
469
469
  end
470
470
  end
@@ -488,7 +488,7 @@ gem 'other', version
488
488
  installer.generate_bin
489
489
 
490
490
  installed_exec = File.join @gemhome, 'bin', 'executable'
491
- assert_path_exists installed_exec
491
+ assert_path_exist installed_exec
492
492
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
493
493
 
494
494
  wrapper = File.read installed_exec
@@ -515,7 +515,7 @@ gem 'other', version
515
515
 
516
516
  installer.generate_bin
517
517
  assert_directory_exists util_inst_bindir
518
- assert_path_exists installed_exec
518
+ assert_path_exist installed_exec
519
519
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
520
520
 
521
521
  assert_match %r{generated by RubyGems}, File.read(installed_exec)
@@ -525,7 +525,7 @@ gem 'other', version
525
525
  end
526
526
 
527
527
  def test_generate_bin_symlink
528
- skip "Symlinks not supported or not enabled" unless symlink_supported?
528
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
529
529
 
530
530
  installer = setup_base_installer
531
531
 
@@ -549,7 +549,7 @@ gem 'other', version
549
549
  installer.wrappers = false
550
550
  installer.generate_bin
551
551
 
552
- refute_path_exists util_inst_bindir
552
+ assert_path_not_exist util_inst_bindir
553
553
  end
554
554
 
555
555
  def test_generate_bin_symlink_no_perms
@@ -562,13 +562,13 @@ gem 'other', version
562
562
  Dir.mkdir util_inst_bindir
563
563
 
564
564
  if win_platform?
565
- skip('test_generate_bin_symlink_no_perms skipped on MS Windows')
565
+ pend('test_generate_bin_symlink_no_perms skipped on MS Windows')
566
566
  elsif Process.uid.zero?
567
- skip('test_user_install_disabled_read_only test skipped in root privilege')
567
+ pend('test_user_install_disabled_read_only test skipped in root privilege')
568
568
  else
569
569
  FileUtils.chmod 0000, util_inst_bindir
570
570
 
571
- assert_raises Gem::FilePermissionError do
571
+ assert_raise Gem::FilePermissionError do
572
572
  installer.generate_bin
573
573
  end
574
574
  end
@@ -577,7 +577,7 @@ gem 'other', version
577
577
  end
578
578
 
579
579
  def test_generate_bin_symlink_update_newer
580
- skip "Symlinks not supported or not enabled" unless symlink_supported?
580
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
581
581
 
582
582
  installer = setup_base_installer
583
583
 
@@ -609,7 +609,7 @@ gem 'other', version
609
609
  end
610
610
 
611
611
  def test_generate_bin_symlink_update_older
612
- skip "Symlinks not supported or not enabled" unless symlink_supported?
612
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
613
613
 
614
614
  installer = setup_base_installer
615
615
 
@@ -647,7 +647,7 @@ gem 'other', version
647
647
  end
648
648
 
649
649
  def test_generate_bin_symlink_update_remove_wrapper
650
- skip "Symlinks not supported or not enabled" unless symlink_supported?
650
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
651
651
 
652
652
  installer = setup_base_installer
653
653
 
@@ -658,7 +658,7 @@ gem 'other', version
658
658
  installer.generate_bin
659
659
 
660
660
  installed_exec = File.join util_inst_bindir, 'executable'
661
- assert_path_exists installed_exec
661
+ assert_path_exist installed_exec
662
662
 
663
663
  @spec = Gem::Specification.new do |s|
664
664
  s.files = ['lib/code.rb']
@@ -701,7 +701,7 @@ gem 'other', version
701
701
 
702
702
  assert_directory_exists util_inst_bindir
703
703
  installed_exec = File.join(util_inst_bindir, 'executable')
704
- assert_path_exists installed_exec
704
+ assert_path_exist installed_exec
705
705
 
706
706
  if symlink_supported?
707
707
  assert File.symlink?(installed_exec)
@@ -720,7 +720,7 @@ gem 'other', version
720
720
  end
721
721
 
722
722
  def test_generate_bin_uses_default_shebang
723
- skip "Symlinks not supported or not enabled" unless symlink_supported?
723
+ pend "Symlinks not supported or not enabled" unless symlink_supported?
724
724
 
725
725
  installer = setup_base_installer
726
726
 
@@ -946,22 +946,22 @@ gem 'other', version
946
946
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
947
947
 
948
948
  Gem.pre_install do
949
- refute_path_exists cache_file, 'cache file must not exist yet'
950
- refute_path_exists spec_file, 'spec file must not exist yet'
949
+ assert_path_not_exist cache_file, 'cache file must not exist yet'
950
+ assert_path_not_exist spec_file, 'spec file must not exist yet'
951
951
  true
952
952
  end
953
953
 
954
954
  Gem.post_build do
955
- assert_path_exists gemdir, 'gem install dir must exist'
956
- assert_path_exists rakefile, 'gem executable must exist'
957
- refute_path_exists stub_exe, 'gem executable must not exist'
958
- refute_path_exists spec_file, 'spec file must not exist yet'
955
+ assert_path_exist gemdir, 'gem install dir must exist'
956
+ assert_path_exist rakefile, 'gem executable must exist'
957
+ assert_path_not_exist stub_exe, 'gem executable must not exist'
958
+ assert_path_not_exist spec_file, 'spec file must not exist yet'
959
959
  true
960
960
  end
961
961
 
962
962
  Gem.post_install do
963
- assert_path_exists cache_file, 'cache file must exist'
964
- assert_path_exists spec_file, 'spec file must exist'
963
+ assert_path_exist cache_file, 'cache file must exist'
964
+ assert_path_exist spec_file, 'spec file must exist'
965
965
  end
966
966
 
967
967
  @newspec = nil
@@ -972,21 +972,21 @@ gem 'other', version
972
972
  end
973
973
 
974
974
  assert_equal @spec, @newspec
975
- assert_path_exists gemdir
976
- assert_path_exists stub_exe, 'gem executable must exist'
975
+ assert_path_exist gemdir
976
+ assert_path_exist stub_exe, 'gem executable must exist'
977
977
 
978
978
  exe = File.join gemdir, 'bin', 'executable'
979
- assert_path_exists exe
979
+ assert_path_exist exe
980
980
 
981
981
  exe_mode = File.stat(exe).mode & 0111
982
982
  assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
983
983
 
984
- assert_path_exists File.join gemdir, 'lib', 'code.rb'
984
+ assert_path_exist File.join gemdir, 'lib', 'code.rb'
985
985
 
986
- assert_path_exists rakefile
986
+ assert_path_exist rakefile
987
987
 
988
988
  assert_equal spec_file, @newspec.loaded_from
989
- assert_path_exists spec_file
989
+ assert_path_exist spec_file
990
990
 
991
991
  assert_same installer, @post_build_hook_arg
992
992
  assert_same installer, @post_install_hook_arg
@@ -1009,7 +1009,7 @@ gem 'other', version
1009
1009
 
1010
1010
  exe = File.join gemdir, 'bin', 'executable'
1011
1011
 
1012
- e = assert_raises RuntimeError do
1012
+ e = assert_raise RuntimeError do
1013
1013
  instance_eval File.read(exe)
1014
1014
  end
1015
1015
 
@@ -1055,7 +1055,7 @@ gem 'other', version
1055
1055
  end
1056
1056
  end
1057
1057
 
1058
- e = assert_raises RuntimeError do
1058
+ e = assert_raise RuntimeError do
1059
1059
  instance_eval File.read(old_bin_file)
1060
1060
  end
1061
1061
 
@@ -1083,7 +1083,7 @@ gem 'other', version
1083
1083
  begin
1084
1084
  Gem::Specification.reset
1085
1085
 
1086
- e = assert_raises Gem::GemNotFoundException do
1086
+ e = assert_raise Gem::GemNotFoundException do
1087
1087
  instance_eval File.read(exe)
1088
1088
  end
1089
1089
  ensure
@@ -1100,7 +1100,7 @@ gem 'other', version
1100
1100
 
1101
1101
  exe = File.join @gemhome, 'bin', 'executable'
1102
1102
 
1103
- assert_path_exists exe, "default gem's executable not installed"
1103
+ assert_path_exist exe, "default gem's executable not installed"
1104
1104
 
1105
1105
  installer = util_setup_installer do |spec|
1106
1106
  spec.name = 'default'
@@ -1118,7 +1118,7 @@ gem 'other', version
1118
1118
  end
1119
1119
  end
1120
1120
 
1121
- e = assert_raises RuntimeError do
1121
+ e = assert_raise RuntimeError do
1122
1122
  instance_eval File.read(exe)
1123
1123
  end
1124
1124
 
@@ -1145,7 +1145,7 @@ gem 'other', version
1145
1145
  begin
1146
1146
  Gem::Specification.reset
1147
1147
 
1148
- e = assert_raises RuntimeError do
1148
+ e = assert_raise RuntimeError do
1149
1149
  instance_eval File.read(exe)
1150
1150
  end
1151
1151
  ensure
@@ -1165,7 +1165,7 @@ gem 'other', version
1165
1165
  end
1166
1166
 
1167
1167
  gemdir = File.join(@gemhome, 'gems', @spec.full_name)
1168
- assert_path_exists File.join gemdir, 'lib', 'code.rb'
1168
+ assert_path_exist File.join gemdir, 'lib', 'code.rb'
1169
1169
 
1170
1170
  installer = util_setup_installer
1171
1171
 
@@ -1188,8 +1188,8 @@ gem 'other', version
1188
1188
  end
1189
1189
  end
1190
1190
 
1191
- assert_path_exists File.join gemdir, 'lib', 'other.rb'
1192
- refute_path_exists File.join gemdir, 'lib', 'code.rb',
1191
+ assert_path_exist File.join gemdir, 'lib', 'other.rb'
1192
+ assert_path_not_exist File.join gemdir, 'lib', 'code.rb',
1193
1193
  "code.rb from prior install of same gem shouldn't remain here"
1194
1194
  end
1195
1195
 
@@ -1204,7 +1204,7 @@ gem 'other', version
1204
1204
  end
1205
1205
 
1206
1206
  gem_dir = File.join(@gemhome, 'gems', 'missing_dep-1')
1207
- assert_path_exists gem_dir
1207
+ assert_path_exist gem_dir
1208
1208
  end
1209
1209
 
1210
1210
  def test_install_build_root
@@ -1231,8 +1231,8 @@ gem 'other', version
1231
1231
  assert_directory_exists File.join(Gem.dir, 'doc')
1232
1232
  assert_directory_exists File.join(Gem.dir, 'specifications')
1233
1233
 
1234
- assert_path_exists File.join @gemhome, 'cache', @spec.file_name
1235
- assert_path_exists File.join @gemhome, 'specifications', @spec.spec_name
1234
+ assert_path_exist File.join @gemhome, 'cache', @spec.file_name
1235
+ assert_path_exist File.join @gemhome, 'specifications', @spec.spec_name
1236
1236
  end
1237
1237
 
1238
1238
  def test_install_post_build_false
@@ -1243,7 +1243,7 @@ gem 'other', version
1243
1243
  end
1244
1244
 
1245
1245
  use_ui @ui do
1246
- e = assert_raises Gem::InstallError do
1246
+ e = assert_raise Gem::InstallError do
1247
1247
  installer.install
1248
1248
  end
1249
1249
 
@@ -1253,10 +1253,10 @@ gem 'other', version
1253
1253
  end
1254
1254
 
1255
1255
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
1256
- refute_path_exists spec_file
1256
+ assert_path_not_exist spec_file
1257
1257
 
1258
1258
  gem_dir = File.join @gemhome, 'gems', @spec.full_name
1259
- refute_path_exists gem_dir
1259
+ assert_path_not_exist gem_dir
1260
1260
  end
1261
1261
 
1262
1262
  def test_install_post_build_nil
@@ -1271,10 +1271,10 @@ gem 'other', version
1271
1271
  end
1272
1272
 
1273
1273
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
1274
- assert_path_exists spec_file
1274
+ assert_path_exist spec_file
1275
1275
 
1276
1276
  gem_dir = File.join @gemhome, 'gems', @spec.full_name
1277
- assert_path_exists gem_dir
1277
+ assert_path_exist gem_dir
1278
1278
  end
1279
1279
 
1280
1280
  def test_install_pre_install_false
@@ -1285,7 +1285,7 @@ gem 'other', version
1285
1285
  end
1286
1286
 
1287
1287
  use_ui @ui do
1288
- e = assert_raises Gem::InstallError do
1288
+ e = assert_raise Gem::InstallError do
1289
1289
  installer.install
1290
1290
  end
1291
1291
 
@@ -1295,7 +1295,7 @@ gem 'other', version
1295
1295
  end
1296
1296
 
1297
1297
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
1298
- refute_path_exists spec_file
1298
+ assert_path_not_exist spec_file
1299
1299
  end
1300
1300
 
1301
1301
  def test_install_pre_install_nil
@@ -1310,7 +1310,7 @@ gem 'other', version
1310
1310
  end
1311
1311
 
1312
1312
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
1313
- assert_path_exists spec_file
1313
+ assert_path_exist spec_file
1314
1314
  end
1315
1315
 
1316
1316
  def test_install_with_message
@@ -1364,7 +1364,7 @@ gem 'other', version
1364
1364
 
1365
1365
  expected_makefile = File.join gemhome2, 'gems', @spec.full_name, 'Makefile'
1366
1366
 
1367
- assert_path_exists expected_makefile
1367
+ assert_path_exist expected_makefile
1368
1368
  end
1369
1369
 
1370
1370
  def test_install_extension_dir_is_removed_on_reinstall
@@ -1393,7 +1393,7 @@ gem 'other', version
1393
1393
  write_file should_be_removed do |io|
1394
1394
  io.write "DELETE ME ON REINSTALL"
1395
1395
  end
1396
- assert_path_exists should_be_removed
1396
+ assert_path_exist should_be_removed
1397
1397
 
1398
1398
  # reinstall the gem, this is also the same as pristine
1399
1399
  use_ui @ui do
@@ -1401,7 +1401,7 @@ gem 'other', version
1401
1401
  installer.install
1402
1402
  end
1403
1403
 
1404
- refute_path_exists should_be_removed
1404
+ assert_path_not_exist should_be_removed
1405
1405
  end
1406
1406
 
1407
1407
  def test_install_user_extension_dir
@@ -1429,13 +1429,13 @@ gem 'other', version
1429
1429
 
1430
1430
  expected_makefile = File.join Gem.user_dir, 'gems', @spec.full_name, 'Makefile'
1431
1431
 
1432
- assert_path_exists expected_makefile
1433
- assert_path_exists expected_extension_dir
1434
- refute_path_exists File.join expected_extension_dir, 'gem_make.out'
1432
+ assert_path_exist expected_makefile
1433
+ assert_path_exist expected_extension_dir
1434
+ assert_path_not_exist File.join expected_extension_dir, 'gem_make.out'
1435
1435
  end
1436
1436
 
1437
1437
  def test_find_lib_file_after_install
1438
- skip "extensions don't quite work on jruby" if Gem.java_platform?
1438
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
1439
1439
 
1440
1440
  @spec = setup_base_spec
1441
1441
  @spec.extensions << "extconf.rb"
@@ -1481,7 +1481,7 @@ gem 'other', version
1481
1481
  end
1482
1482
 
1483
1483
  def test_install_extension_and_script
1484
- skip "Makefile creation crashes on jruby" if Gem.java_platform?
1484
+ pend "Makefile creation crashes on jruby" if Gem.java_platform?
1485
1485
 
1486
1486
  @spec = setup_base_spec
1487
1487
  @spec.extensions << "extconf.rb"
@@ -1509,65 +1509,67 @@ gem 'other', version
1509
1509
  RUBY
1510
1510
  end
1511
1511
 
1512
- refute_path_exists File.join @spec.gem_dir, rb
1513
- refute_path_exists File.join @spec.gem_dir, rb2
1512
+ assert_path_not_exist File.join @spec.gem_dir, rb
1513
+ assert_path_not_exist File.join @spec.gem_dir, rb2
1514
1514
  use_ui @ui do
1515
1515
  path = Gem::Package.build @spec
1516
1516
 
1517
1517
  installer = Gem::Installer.at path
1518
1518
  installer.install
1519
1519
  end
1520
- assert_path_exists File.join @spec.gem_dir, rb
1521
- assert_path_exists File.join @spec.gem_dir, rb2
1520
+ assert_path_exist File.join @spec.gem_dir, rb
1521
+ assert_path_exist File.join @spec.gem_dir, rb2
1522
1522
  end
1523
1523
 
1524
1524
  def test_install_extension_flat
1525
- skip "extensions don't quite work on jruby" if Gem.java_platform?
1525
+ pend "extensions don't quite work on jruby" if Gem.java_platform?
1526
1526
 
1527
- @spec = setup_base_spec
1528
- @spec.require_paths = ["."]
1527
+ begin
1528
+ @spec = setup_base_spec
1529
+ @spec.require_paths = ["."]
1529
1530
 
1530
- @spec.extensions << "extconf.rb"
1531
+ @spec.extensions << "extconf.rb"
1531
1532
 
1532
- write_file File.join(@tempdir, "extconf.rb") do |io|
1533
- io.write <<-RUBY
1534
- require "mkmf"
1533
+ write_file File.join(@tempdir, "extconf.rb") do |io|
1534
+ io.write <<-RUBY
1535
+ require "mkmf"
1535
1536
 
1536
- CONFIG['CC'] = '$(TOUCH) $@ ||'
1537
- CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
1538
- $ruby = '#{Gem.ruby}'
1537
+ CONFIG['CC'] = '$(TOUCH) $@ ||'
1538
+ CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
1539
+ $ruby = '#{Gem.ruby}'
1539
1540
 
1540
- create_makefile("#{@spec.name}")
1541
- RUBY
1542
- end
1541
+ create_makefile("#{@spec.name}")
1542
+ RUBY
1543
+ end
1543
1544
 
1544
- # empty depend file for no auto dependencies
1545
- @spec.files += %W[depend #{@spec.name}.c].each do |file|
1546
- write_file File.join(@tempdir, file)
1547
- end
1545
+ # empty depend file for no auto dependencies
1546
+ @spec.files += %W[depend #{@spec.name}.c].each do |file|
1547
+ write_file File.join(@tempdir, file)
1548
+ end
1548
1549
 
1549
- so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
1550
- refute_path_exists so
1551
- use_ui @ui do
1552
- path = Gem::Package.build @spec
1550
+ so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
1551
+ assert_path_not_exist so
1552
+ use_ui @ui do
1553
+ path = Gem::Package.build @spec
1553
1554
 
1554
- installer = Gem::Installer.at path
1555
- installer.install
1556
- end
1557
- assert_path_exists so
1558
- rescue
1559
- puts '-' * 78
1560
- puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
1561
- puts '-' * 78
1555
+ installer = Gem::Installer.at path
1556
+ installer.install
1557
+ end
1558
+ assert_path_exist so
1559
+ rescue
1560
+ puts '-' * 78
1561
+ puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
1562
+ puts '-' * 78
1562
1563
 
1563
- path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
1564
+ path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
1564
1565
 
1565
- if File.exist?(path)
1566
- puts File.read(path)
1567
- puts '-' * 78
1568
- end
1566
+ if File.exist?(path)
1567
+ puts File.read(path)
1568
+ puts '-' * 78
1569
+ end
1569
1570
 
1570
- raise
1571
+ raise
1572
+ end
1571
1573
  end
1572
1574
 
1573
1575
  def test_installation_satisfies_dependency_eh
@@ -1600,7 +1602,7 @@ gem 'other', version
1600
1602
  installer.force = false
1601
1603
 
1602
1604
  use_ui @ui do
1603
- assert_raises Gem::InstallError do
1605
+ assert_raise Gem::InstallError do
1604
1606
  installer.install
1605
1607
  end
1606
1608
  end
@@ -1659,7 +1661,7 @@ gem 'other', version
1659
1661
 
1660
1662
  use_ui @ui do
1661
1663
  installer = Gem::Installer.at gem
1662
- e = assert_raises Gem::InstallError do
1664
+ e = assert_raise Gem::InstallError do
1663
1665
  installer.pre_install_checks
1664
1666
  end
1665
1667
  assert_equal '#<Gem::Specification name=../malicious version=1> has an invalid name', e.message
@@ -1679,7 +1681,7 @@ gem 'other', version
1679
1681
 
1680
1682
  use_ui @ui do
1681
1683
  installer = Gem::Installer.at gem
1682
- e = assert_raises Gem::InstallError do
1684
+ e = assert_raise Gem::InstallError do
1683
1685
  installer.pre_install_checks
1684
1686
  end
1685
1687
  assert_equal "#<Gem::Specification name=malicious\n::Object.const_set(:FROM_EVAL, true)# version=1> has an invalid name", e.message
@@ -1701,7 +1703,7 @@ gem 'other', version
1701
1703
 
1702
1704
  use_ui @ui do
1703
1705
  installer = Gem::Installer.at gem
1704
- e = assert_raises Gem::InstallError do
1706
+ e = assert_raise Gem::InstallError do
1705
1707
  installer.pre_install_checks
1706
1708
  end
1707
1709
  assert_equal "#<Gem::Specification name=malicious version=1> has an invalid require_paths", e.message
@@ -1709,7 +1711,7 @@ gem 'other', version
1709
1711
  end
1710
1712
 
1711
1713
  def test_pre_install_checks_malicious_extensions_before_eval
1712
- skip "mswin environment disallow to create file contained the carriage return code." if Gem.win_platform?
1714
+ pend "mswin environment disallow to create file contained the carriage return code." if Gem.win_platform?
1713
1715
 
1714
1716
  spec = util_spec "malicious", '1'
1715
1717
  def spec.full_name # so the spec is buildable
@@ -1724,7 +1726,7 @@ gem 'other', version
1724
1726
 
1725
1727
  use_ui @ui do
1726
1728
  installer = Gem::Installer.at gem
1727
- e = assert_raises Gem::InstallError do
1729
+ e = assert_raise Gem::InstallError do
1728
1730
  installer.pre_install_checks
1729
1731
  end
1730
1732
  assert_equal "#<Gem::Specification name=malicious version=1> has an invalid extensions", e.message
@@ -1745,7 +1747,7 @@ gem 'other', version
1745
1747
 
1746
1748
  use_ui @ui do
1747
1749
  installer = Gem::Installer.at gem
1748
- e = assert_raises Gem::InstallError do
1750
+ e = assert_raise Gem::InstallError do
1749
1751
  installer.pre_install_checks
1750
1752
  end
1751
1753
  assert_equal "#<Gem::Specification name=malicious version=1> has an invalid specification_version", e.message
@@ -1767,7 +1769,7 @@ gem 'other', version
1767
1769
  use_ui @ui do
1768
1770
  installer = Gem::Installer.at gem
1769
1771
  installer.ignore_dependencies = true
1770
- e = assert_raises Gem::InstallError do
1772
+ e = assert_raise Gem::InstallError do
1771
1773
  installer.pre_install_checks
1772
1774
  end
1773
1775
  assert_equal "#<Gem::Specification name=malicious version=1> has an invalid dependencies", e.message
@@ -1991,14 +1993,14 @@ gem 'other', version
1991
1993
  installer.unpack dest
1992
1994
  end
1993
1995
 
1994
- assert_path_exists File.join dest, 'lib', 'code.rb'
1995
- assert_path_exists File.join dest, 'bin', 'executable'
1996
+ assert_path_exist File.join dest, 'lib', 'code.rb'
1997
+ assert_path_exist File.join dest, 'bin', 'executable'
1996
1998
  end
1997
1999
 
1998
2000
  def test_write_build_info_file
1999
2001
  installer = setup_base_installer
2000
2002
 
2001
- refute_path_exists @spec.build_info_file
2003
+ assert_path_not_exist @spec.build_info_file
2002
2004
 
2003
2005
  installer.build_args = %w[
2004
2006
  --with-libyaml-dir /usr/local/Cellar/libyaml/0.1.4
@@ -2006,7 +2008,7 @@ gem 'other', version
2006
2008
 
2007
2009
  installer.write_build_info_file
2008
2010
 
2009
- assert_path_exists @spec.build_info_file
2011
+ assert_path_exist @spec.build_info_file
2010
2012
 
2011
2013
  expected = "--with-libyaml-dir\n/usr/local/Cellar/libyaml/0.1.4\n"
2012
2014
 
@@ -2016,11 +2018,11 @@ gem 'other', version
2016
2018
  def test_write_build_info_file_empty
2017
2019
  installer = setup_base_installer
2018
2020
 
2019
- refute_path_exists @spec.build_info_file
2021
+ assert_path_not_exist @spec.build_info_file
2020
2022
 
2021
2023
  installer.write_build_info_file
2022
2024
 
2023
- refute_path_exists @spec.build_info_file
2025
+ assert_path_not_exist @spec.build_info_file
2024
2026
  end
2025
2027
 
2026
2028
  def test_write_build_info_file_install_dir
@@ -2033,8 +2035,8 @@ gem 'other', version
2033
2035
 
2034
2036
  installer.write_build_info_file
2035
2037
 
2036
- refute_path_exists @spec.build_info_file
2037
- assert_path_exists \
2038
+ assert_path_not_exist @spec.build_info_file
2039
+ assert_path_exist \
2038
2040
  File.join("#{@gemhome}2", 'build_info', "#{@spec.full_name}.info")
2039
2041
  end
2040
2042
 
@@ -2044,27 +2046,27 @@ gem 'other', version
2044
2046
  gem = File.join @gemhome, @spec.file_name
2045
2047
 
2046
2048
  FileUtils.mv cache_file, gem
2047
- refute_path_exists cache_file
2049
+ assert_path_not_exist cache_file
2048
2050
 
2049
2051
  installer = Gem::Installer.at gem
2050
2052
  installer.gem_home = @gemhome
2051
2053
 
2052
2054
  installer.write_cache_file
2053
2055
 
2054
- assert_path_exists cache_file
2056
+ assert_path_exist cache_file
2055
2057
  end
2056
2058
 
2057
2059
  def test_write_spec
2058
2060
  @spec = setup_base_spec
2059
2061
  FileUtils.rm @spec.spec_file
2060
- refute_path_exists @spec.spec_file
2062
+ assert_path_not_exist @spec.spec_file
2061
2063
 
2062
2064
  installer = Gem::Installer.for_spec @spec
2063
2065
  installer.gem_home = @gemhome
2064
2066
 
2065
2067
  installer.write_spec
2066
2068
 
2067
- assert_path_exists @spec.spec_file
2069
+ assert_path_exist @spec.spec_file
2068
2070
 
2069
2071
  loaded = Gem::Specification.load @spec.spec_file
2070
2072
 
@@ -2076,7 +2078,7 @@ gem 'other', version
2076
2078
  def test_write_spec_writes_cached_spec
2077
2079
  @spec = setup_base_spec
2078
2080
  FileUtils.rm @spec.spec_file
2079
- refute_path_exists @spec.spec_file
2081
+ assert_path_not_exist @spec.spec_file
2080
2082
 
2081
2083
  @spec.files = %w[a.rb b.rb c.rb]
2082
2084
 
@@ -2119,7 +2121,7 @@ gem 'other', version
2119
2121
 
2120
2122
  assert_directory_exists File.join(@spec.gem_dir, 'bin')
2121
2123
  installed_exec = File.join @spec.gem_dir, 'bin', 'executable'
2122
- assert_path_exists installed_exec
2124
+ assert_path_exist installed_exec
2123
2125
 
2124
2126
  assert_directory_exists File.join(Gem.default_dir, 'specifications')
2125
2127
  assert_directory_exists File.join(Gem.default_dir, 'specifications', 'default')
@@ -2131,7 +2133,7 @@ gem 'other', version
2131
2133
  assert_directory_exists util_inst_bindir
2132
2134
 
2133
2135
  installed_exec = File.join util_inst_bindir, 'executable'
2134
- assert_path_exists installed_exec
2136
+ assert_path_exist installed_exec
2135
2137
 
2136
2138
  wrapper = File.read installed_exec
2137
2139
 
@@ -2157,7 +2159,7 @@ gem 'other', version
2157
2159
  assert_directory_exists util_inst_bindir
2158
2160
 
2159
2161
  installed_exec = File.join util_inst_bindir, 'executable'
2160
- assert_path_exists installed_exec
2162
+ assert_path_exist installed_exec
2161
2163
 
2162
2164
  wrapper = File.read installed_exec
2163
2165
  assert_match %r{generated by RubyGems}, wrapper
@@ -2183,7 +2185,7 @@ gem 'other', version
2183
2185
 
2184
2186
  assert_directory_exists File.join(@spec.gem_dir, 'exe')
2185
2187
  installed_exec = File.join @spec.gem_dir, 'exe', 'executable'
2186
- assert_path_exists installed_exec
2188
+ assert_path_exist installed_exec
2187
2189
 
2188
2190
  assert_directory_exists File.join(Gem.default_dir, 'specifications')
2189
2191
  assert_directory_exists File.join(Gem.default_dir, 'specifications', 'default')