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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Manifest.txt +2 -0
- data/Rakefile +1 -6
- data/bundler/CHANGELOG.md +16 -0
- data/bundler/bundler.gemspec +2 -3
- data/bundler/lib/bundler.rb +1 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +13 -33
- data/bundler/lib/bundler/cli/outdated.rb +7 -10
- data/bundler/lib/bundler/definition.rb +14 -75
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/friendly_errors.rb +1 -1
- data/bundler/lib/bundler/index.rb +1 -2
- 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 +13 -96
- data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
- data/bundler/lib/bundler/rubygems_ext.rb +2 -2
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source.rb +9 -0
- data/bundler/lib/bundler/source/rubygems.rb +15 -4
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
- data/bundler/lib/bundler/source_list.rb +29 -10
- data/bundler/lib/bundler/source_map.rb +58 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
- data/lib/rubygems/specification.rb +0 -2
- data/lib/rubygems/test_case.rb +102 -18
- data/rubygems-update.gemspec +1 -1
- 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 +2 -2
- data/test/rubygems/test_gem_command.rb +1 -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 +1 -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 -6
- 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 +6 -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 +6 -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 -8
- data/test/rubygems/test_gem_install_update_options.rb +9 -9
- data/test/rubygems/test_gem_installer.rb +142 -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 +83 -103
- 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 +4 -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 +13 -13
- data/test/test_changelog_generator.rb +1 -2
- metadata +5 -3
@@ -132,12 +132,12 @@ install:
|
|
132
132
|
@builder.build_extensions
|
133
133
|
end
|
134
134
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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
|
-
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
10
|
+
pend "CmakeBuilder doesn't work on Windows." if Gem.win_platform?
|
11
11
|
|
12
12
|
begin
|
13
13
|
_, status = Open3.capture2e('cmake')
|
14
|
-
|
14
|
+
pend 'cmake not present' unless status.success?
|
15
15
|
rescue Errno::ENOENT
|
16
|
-
|
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 =
|
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
|
-
|
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
|
-
|
45
|
+
pend("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
|
46
46
|
output = []
|
47
47
|
|
48
|
-
error =
|
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
|
-
|
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
|
-
|
19
|
+
pend("failing on jruby")
|
20
20
|
end
|
21
21
|
|
22
22
|
if vc_windows? && !nmake_found?
|
23
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
103
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL
|
104
104
|
|
105
105
|
@cmd.add_install_update_options
|
106
106
|
|
107
|
-
e =
|
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
|
-
|
128
|
-
|
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
|
-
|
140
|
+
pend('test_user_install_disabled_read_only test skipped on MS Windows')
|
141
141
|
elsif Process.uid.zero?
|
142
|
-
|
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
|
-
|
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 =
|
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
|
-
|
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 =
|
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
|
-
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
461
|
+
pend('test_generate_bin_script_no_perms skipped on MS Windows')
|
462
462
|
elsif Process.uid.zero?
|
463
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
565
|
+
pend('test_generate_bin_symlink_no_perms skipped on MS Windows')
|
566
566
|
elsif Process.uid.zero?
|
567
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
950
|
-
|
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
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
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
|
-
|
964
|
-
|
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
|
-
|
976
|
-
|
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
|
-
|
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
|
-
|
984
|
+
assert_path_exist File.join gemdir, 'lib', 'code.rb'
|
985
985
|
|
986
|
-
|
986
|
+
assert_path_exist rakefile
|
987
987
|
|
988
988
|
assert_equal spec_file, @newspec.loaded_from
|
989
|
-
|
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 =
|
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 =
|
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 =
|
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
|
-
|
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 =
|
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 =
|
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
|
-
|
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
|
-
|
1192
|
-
|
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
|
-
|
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
|
-
|
1235
|
-
|
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 =
|
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
|
-
|
1256
|
+
assert_path_not_exist spec_file
|
1257
1257
|
|
1258
1258
|
gem_dir = File.join @gemhome, 'gems', @spec.full_name
|
1259
|
-
|
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
|
-
|
1274
|
+
assert_path_exist spec_file
|
1275
1275
|
|
1276
1276
|
gem_dir = File.join @gemhome, 'gems', @spec.full_name
|
1277
|
-
|
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 =
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
1433
|
-
|
1434
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
1513
|
-
|
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
|
-
|
1521
|
-
|
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
|
-
|
1525
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1526
1526
|
|
1527
|
-
|
1528
|
-
|
1527
|
+
begin
|
1528
|
+
@spec = setup_base_spec
|
1529
|
+
@spec.require_paths = ["."]
|
1529
1530
|
|
1530
|
-
|
1531
|
+
@spec.extensions << "extconf.rb"
|
1531
1532
|
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1533
|
+
write_file File.join(@tempdir, "extconf.rb") do |io|
|
1534
|
+
io.write <<-RUBY
|
1535
|
+
require "mkmf"
|
1535
1536
|
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1537
|
+
CONFIG['CC'] = '$(TOUCH) $@ ||'
|
1538
|
+
CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
|
1539
|
+
$ruby = '#{Gem.ruby}'
|
1539
1540
|
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1541
|
+
create_makefile("#{@spec.name}")
|
1542
|
+
RUBY
|
1543
|
+
end
|
1543
1544
|
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
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
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
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
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
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
|
-
|
1564
|
+
path = File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
|
1564
1565
|
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1566
|
+
if File.exist?(path)
|
1567
|
+
puts File.read(path)
|
1568
|
+
puts '-' * 78
|
1569
|
+
end
|
1569
1570
|
|
1570
|
-
|
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
|
-
|
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 =
|
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 =
|
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 =
|
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
|
-
|
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 =
|
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 =
|
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 =
|
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
|
-
|
1995
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
2021
|
+
assert_path_not_exist @spec.build_info_file
|
2020
2022
|
|
2021
2023
|
installer.write_build_info_file
|
2022
2024
|
|
2023
|
-
|
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
|
-
|
2037
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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')
|