rubygems-update 3.2.17 → 3.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/Manifest.txt +3 -0
- data/Rakefile +6 -6
- data/bundler/CHANGELOG.md +54 -0
- data/bundler/bundler.gemspec +2 -3
- data/bundler/lib/bundler.rb +2 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +13 -33
- data/bundler/lib/bundler/cli/check.rb +4 -2
- data/bundler/lib/bundler/cli/install.rb +6 -7
- data/bundler/lib/bundler/cli/outdated.rb +9 -10
- data/bundler/lib/bundler/definition.rb +29 -82
- data/bundler/lib/bundler/feature_flag.rb +0 -2
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher/index.rb +0 -1
- data/bundler/lib/bundler/friendly_errors.rb +2 -4
- data/bundler/lib/bundler/index.rb +1 -2
- data/bundler/lib/bundler/installer.rb +1 -8
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -7
- data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -8
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +14 -0
- data/bundler/lib/bundler/resolver.rb +15 -96
- data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
- data/bundler/lib/bundler/rubygems_ext.rb +2 -2
- data/bundler/lib/bundler/rubygems_integration.rb +4 -3
- data/bundler/lib/bundler/settings.rb +21 -3
- data/bundler/lib/bundler/source.rb +11 -0
- data/bundler/lib/bundler/source/rubygems.rb +24 -11
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
- data/bundler/lib/bundler/source_list.rb +35 -10
- data/bundler/lib/bundler/source_map.rb +58 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/command.rb +2 -0
- data/lib/rubygems/commands/build_command.rb +1 -1
- data/lib/rubygems/config_file.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
- data/lib/rubygems/installer.rb +4 -0
- data/lib/rubygems/request.rb +1 -1
- data/lib/rubygems/specification.rb +0 -2
- data/lib/rubygems/specification_policy.rb +5 -4
- data/lib/rubygems/test_case.rb +106 -18
- data/lib/rubygems/util/licenses.rb +107 -2
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -2
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/test_bundled_ca.rb +2 -2
- data/test/rubygems/test_deprecate.rb +3 -3
- data/test/rubygems/test_gem.rb +33 -31
- data/test/rubygems/test_gem_bundler_version_finder.rb +3 -5
- data/test/rubygems/test_gem_command.rb +13 -1
- data/test/rubygems/test_gem_command_manager.rb +5 -5
- data/test/rubygems/test_gem_commands_build_command.rb +10 -10
- data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
- data/test/rubygems/test_gem_commands_check_command.rb +5 -5
- data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
- data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
- data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
- data/test/rubygems/test_gem_commands_help_command.rb +8 -1
- data/test/rubygems/test_gem_commands_install_command.rb +60 -60
- data/test/rubygems/test_gem_commands_list_command.rb +1 -1
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +8 -9
- data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
- data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
- data/test/rubygems/test_gem_commands_push_command.rb +6 -11
- data/test/rubygems/test_gem_commands_query_command.rb +7 -7
- data/test/rubygems/test_gem_commands_server_command.rb +2 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
- data/test/rubygems/test_gem_commands_signin_command.rb +13 -6
- data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
- data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
- data/test/rubygems/test_gem_commands_update_command.rb +10 -10
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +9 -9
- data/test/rubygems/test_gem_dependency.rb +12 -6
- data/test/rubygems/test_gem_dependency_installer.rb +4 -4
- data/test/rubygems/test_gem_doctor.rb +30 -30
- data/test/rubygems/test_gem_ext_builder.rb +20 -20
- data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -14
- data/test/rubygems/test_gem_install_update_options.rb +9 -9
- data/test/rubygems/test_gem_installer.rb +162 -140
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_package.rb +48 -48
- data/test/rubygems/test_gem_package_old.rb +9 -9
- data/test/rubygems/test_gem_package_tar_header.rb +5 -5
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
- data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +1 -1
- data/test/rubygems/test_gem_rdoc.rb +9 -9
- data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
- data/test/rubygems/test_gem_request_set.rb +15 -14
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
- data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
- data/test/rubygems/test_gem_requirement.rb +13 -13
- data/test/rubygems/test_gem_resolver.rb +11 -11
- data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
- data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
- data/test/rubygems/test_gem_security.rb +5 -5
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +7 -7
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
- data/test/rubygems/test_gem_server.rb +2 -2
- data/test/rubygems/test_gem_silent_ui.rb +9 -9
- data/test/rubygems/test_gem_source.rb +2 -2
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
- data/test/rubygems/test_gem_source_git.rb +11 -11
- data/test/rubygems/test_gem_source_specific_file.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +86 -106
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_stub_specification.rb +4 -4
- data/test/rubygems/test_gem_uninstaller.rb +16 -16
- data/test/rubygems/test_gem_util.rb +8 -6
- data/test/rubygems/test_gem_version.rb +4 -13
- data/test/rubygems/test_kernel.rb +6 -4
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +12 -14
- data/test/test_changelog_generator.rb +1 -2
- metadata +6 -3
@@ -57,19 +57,19 @@ class TestGemPackageTarHeader < Gem::Package::TarTestCase
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_initialize_bad
|
60
|
-
|
60
|
+
assert_raise ArgumentError do
|
61
61
|
Gem::Package::TarHeader.new :name => '', :size => '', :mode => ''
|
62
62
|
end
|
63
63
|
|
64
|
-
|
64
|
+
assert_raise ArgumentError do
|
65
65
|
Gem::Package::TarHeader.new :name => '', :size => '', :prefix => ''
|
66
66
|
end
|
67
67
|
|
68
|
-
|
68
|
+
assert_raise ArgumentError do
|
69
69
|
Gem::Package::TarHeader.new :name => '', :prefix => '', :mode => ''
|
70
70
|
end
|
71
71
|
|
72
|
-
|
72
|
+
assert_raise ArgumentError do
|
73
73
|
Gem::Package::TarHeader.new :prefix => '', :size => '', :mode => ''
|
74
74
|
end
|
75
75
|
end
|
@@ -156,7 +156,7 @@ group\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
|
|
156
156
|
# overwrite the size field
|
157
157
|
header_s[124, 12] = val
|
158
158
|
io = TempIO.new header_s
|
159
|
-
|
159
|
+
assert_raise ArgumentError do
|
160
160
|
Gem::Package::TarHeader.from io
|
161
161
|
end
|
162
162
|
io.close!
|
@@ -42,19 +42,19 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
|
|
42
42
|
|
43
43
|
assert @entry.bytes_read
|
44
44
|
|
45
|
-
e =
|
45
|
+
e = assert_raise(IOError) { @entry.eof? }
|
46
46
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
47
47
|
|
48
|
-
e =
|
48
|
+
e = assert_raise(IOError) { @entry.getc }
|
49
49
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
50
50
|
|
51
|
-
e =
|
51
|
+
e = assert_raise(IOError) { @entry.pos }
|
52
52
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
53
53
|
|
54
|
-
e =
|
54
|
+
e = assert_raise(IOError) { @entry.read }
|
55
55
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
56
56
|
|
57
|
-
e =
|
57
|
+
e = assert_raise(IOError) { @entry.rewind }
|
58
58
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
59
59
|
end
|
60
60
|
|
@@ -75,10 +75,10 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def test_full_name_null
|
78
|
-
|
78
|
+
pend "jruby strips the null byte and does not think it's corrupt" if Gem.java_platform?
|
79
79
|
@entry.header.prefix << "\000"
|
80
80
|
|
81
|
-
e =
|
81
|
+
e = assert_raise Gem::Package::TarInvalidError do
|
82
82
|
@entry.full_name
|
83
83
|
end
|
84
84
|
|
@@ -134,7 +134,7 @@ class TestGemPackageTarReaderEntry < Gem::Package::TarTestCase
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def test_readpartial
|
137
|
-
|
137
|
+
assert_raise(EOFError) do
|
138
138
|
@entry.read(@contents.size)
|
139
139
|
@entry.readpartial(1)
|
140
140
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'rubygems/package/tar_test_case'
|
3
3
|
require 'rubygems/package/tar_writer'
|
4
|
-
require 'minitest/mock'
|
5
4
|
|
6
5
|
class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
7
6
|
def setup
|
@@ -117,7 +116,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
117
116
|
end
|
118
117
|
|
119
118
|
def test_add_file_signer
|
120
|
-
|
119
|
+
pend 'openssl is missing' unless Gem::HAVE_OPENSSL
|
121
120
|
|
122
121
|
signer = Gem::Security::Signer.new PRIVATE_KEY, [PUBLIC_CERT]
|
123
122
|
|
@@ -150,13 +149,12 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
150
149
|
signer = Gem::Security::Signer.new nil, nil
|
151
150
|
|
152
151
|
Time.stub :now, Time.at(1458518157) do
|
153
|
-
|
154
152
|
@tar_writer.add_file_signed 'x', 0644, signer do |io|
|
155
153
|
io.write 'a' * 10
|
156
154
|
end
|
157
155
|
|
158
156
|
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now),
|
159
|
-
|
157
|
+
@io.string[0, 512])
|
160
158
|
end
|
161
159
|
assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
|
162
160
|
|
@@ -170,11 +168,11 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
170
168
|
end
|
171
169
|
|
172
170
|
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now),
|
173
|
-
|
174
|
-
end
|
171
|
+
@io.string[0, 512])
|
175
172
|
|
176
|
-
|
177
|
-
|
173
|
+
assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512]
|
174
|
+
assert_equal 1024, @io.pos
|
175
|
+
end
|
178
176
|
end
|
179
177
|
|
180
178
|
def test_add_file_simple_source_date_epoch
|
@@ -185,7 +183,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
185
183
|
end
|
186
184
|
|
187
185
|
assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.at(ENV["SOURCE_DATE_EPOCH"].to_i).utc),
|
188
|
-
|
186
|
+
@io.string[0, 512])
|
189
187
|
end
|
190
188
|
end
|
191
189
|
|
@@ -194,7 +192,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
194
192
|
@tar_writer.add_file_simple 'x', 0, 100
|
195
193
|
|
196
194
|
assert_headers_equal tar_file_header('x', '', 0, 100, Time.now),
|
197
|
-
|
195
|
+
@io.string[0, 512]
|
198
196
|
end
|
199
197
|
|
200
198
|
assert_equal "\0" * 512, @io.string[512, 512]
|
@@ -209,7 +207,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
209
207
|
end
|
210
208
|
|
211
209
|
def test_add_file_simple_size
|
212
|
-
|
210
|
+
assert_raise Gem::Package::TarWriter::FileOverflow do
|
213
211
|
@tar_writer.add_file_simple("lib/foo/bar", 0, 10) do |io|
|
214
212
|
io.write "1" * 11
|
215
213
|
end
|
@@ -221,27 +219,27 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
221
219
|
|
222
220
|
assert_equal "\0" * 1024, @io.string
|
223
221
|
|
224
|
-
e =
|
222
|
+
e = assert_raise IOError do
|
225
223
|
@tar_writer.close
|
226
224
|
end
|
227
225
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
228
226
|
|
229
|
-
e =
|
227
|
+
e = assert_raise IOError do
|
230
228
|
@tar_writer.flush
|
231
229
|
end
|
232
230
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
233
231
|
|
234
|
-
e =
|
232
|
+
e = assert_raise IOError do
|
235
233
|
@tar_writer.add_file 'x', 0
|
236
234
|
end
|
237
235
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
238
236
|
|
239
|
-
e =
|
237
|
+
e = assert_raise IOError do
|
240
238
|
@tar_writer.add_file_simple 'x', 0, 0
|
241
239
|
end
|
242
240
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
243
241
|
|
244
|
-
e =
|
242
|
+
e = assert_raise IOError do
|
245
243
|
@tar_writer.mkdir 'x', 0
|
246
244
|
end
|
247
245
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
@@ -297,7 +295,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
297
295
|
assert_equal ['b' * 100, 'a'], @tar_writer.split_name(name)
|
298
296
|
|
299
297
|
name = File.join 'a', 'b' * 101
|
300
|
-
exception =
|
298
|
+
exception = assert_raise Gem::Package::TooLongFileName do
|
301
299
|
@tar_writer.split_name name
|
302
300
|
end
|
303
301
|
assert_includes exception.message, name
|
@@ -305,7 +303,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
305
303
|
# note, GNU tar 1.28 is unable to handle this case too,
|
306
304
|
# tested with "tar --format=ustar -cPf /tmp/foo.tartar -- /aaaaaa....a"
|
307
305
|
name = '/' + 'a' * 100
|
308
|
-
exception =
|
306
|
+
exception = assert_raise Gem::Package::TooLongFileName do
|
309
307
|
@tar_writer.split_name name
|
310
308
|
end
|
311
309
|
assert_includes exception.message, name
|
@@ -316,7 +314,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
316
314
|
assert_equal ['b', 'a' * 155], @tar_writer.split_name(name)
|
317
315
|
|
318
316
|
name = File.join 'a' * 156, 'b'
|
319
|
-
exception =
|
317
|
+
exception = assert_raise Gem::Package::TooLongFileName do
|
320
318
|
@tar_writer.split_name name
|
321
319
|
end
|
322
320
|
assert_includes exception.message, name
|
@@ -324,7 +322,7 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase
|
|
324
322
|
|
325
323
|
def test_split_name_too_long_total
|
326
324
|
name = 'a' * 257
|
327
|
-
exception =
|
325
|
+
exception = assert_raise Gem::Package::TooLongFileName do
|
328
326
|
@tar_writer.split_name name
|
329
327
|
end
|
330
328
|
assert_includes exception.message, name
|
@@ -40,7 +40,7 @@ class TestGemPackageTask < Gem::TestCase
|
|
40
40
|
|
41
41
|
Rake.application['package'].invoke
|
42
42
|
|
43
|
-
|
43
|
+
assert_path_exist 'pkg/pkgr-1.2.3.gem'
|
44
44
|
end
|
45
45
|
ensure
|
46
46
|
RakeFileUtils.verbose_flag = original_rake_fileutils_verbosity
|
@@ -56,7 +56,7 @@ class TestGemPackageTask < Gem::TestCase
|
|
56
56
|
g.summary = 'summary'
|
57
57
|
end
|
58
58
|
|
59
|
-
_, err =
|
59
|
+
_, err = capture_output do
|
60
60
|
Rake.application = Rake::Application.new
|
61
61
|
|
62
62
|
pkg = Gem::PackageTask.new(gem) do |p|
|
@@ -130,7 +130,7 @@ class TestGemPathSupport < Gem::TestCase
|
|
130
130
|
begin
|
131
131
|
File.symlink(dir, symlink)
|
132
132
|
rescue NotImplementedError, SystemCallError
|
133
|
-
|
133
|
+
pend 'symlinks not supported'
|
134
134
|
end
|
135
135
|
not_existing = "#{@tempdir}/does_not_exist"
|
136
136
|
path = "#{symlink}#{File::PATH_SEPARATOR}#{not_existing}"
|
@@ -24,7 +24,7 @@ class TestGemRDoc < Gem::TestCase
|
|
24
24
|
begin
|
25
25
|
Gem::RDoc.load_rdoc
|
26
26
|
rescue Gem::DocumentError => e
|
27
|
-
|
27
|
+
pend e.message
|
28
28
|
end
|
29
29
|
|
30
30
|
Gem.configuration[:rdoc] = nil
|
@@ -84,16 +84,16 @@ class TestGemRDoc < Gem::TestCase
|
|
84
84
|
refute @hook.rdoc_installed?
|
85
85
|
refute @hook.ri_installed?
|
86
86
|
|
87
|
-
|
87
|
+
assert_path_exist @a.doc_dir
|
88
88
|
end
|
89
89
|
|
90
90
|
def test_remove_unwritable
|
91
|
-
|
92
|
-
|
91
|
+
pend 'chmod not supported' if Gem.win_platform?
|
92
|
+
pend 'skipped in root privilege' if Process.uid.zero?
|
93
93
|
FileUtils.mkdir_p @a.base_dir
|
94
94
|
FileUtils.chmod 0, @a.base_dir
|
95
95
|
|
96
|
-
e =
|
96
|
+
e = assert_raise Gem::FilePermissionError do
|
97
97
|
@hook.remove
|
98
98
|
end
|
99
99
|
|
@@ -113,16 +113,16 @@ class TestGemRDoc < Gem::TestCase
|
|
113
113
|
def test_setup
|
114
114
|
@hook.setup
|
115
115
|
|
116
|
-
|
116
|
+
assert_path_exist @a.doc_dir
|
117
117
|
end
|
118
118
|
|
119
119
|
def test_setup_unwritable
|
120
|
-
|
121
|
-
|
120
|
+
pend 'chmod not supported' if Gem.win_platform?
|
121
|
+
pend 'skipped in root privilege' if Process.uid.zero?
|
122
122
|
FileUtils.mkdir_p @a.doc_dir
|
123
123
|
FileUtils.chmod 0, @a.doc_dir
|
124
124
|
|
125
|
-
e =
|
125
|
+
e = assert_raise Gem::FilePermissionError do
|
126
126
|
@hook.setup
|
127
127
|
end
|
128
128
|
|
@@ -10,7 +10,6 @@ end
|
|
10
10
|
|
11
11
|
require 'rubygems/remote_fetcher'
|
12
12
|
require 'rubygems/package'
|
13
|
-
require 'minitest/mock'
|
14
13
|
|
15
14
|
# = Testing Proxy Settings
|
16
15
|
#
|
@@ -146,7 +145,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
146
145
|
fetcher = Gem::RemoteFetcher.new nil
|
147
146
|
@fetcher = fetcher
|
148
147
|
|
149
|
-
e =
|
148
|
+
e = assert_raise ArgumentError do
|
150
149
|
@fetcher.fetch_path("gems.example.com/yaml", nil, true)
|
151
150
|
end
|
152
151
|
|
@@ -184,7 +183,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
184
183
|
|
185
184
|
assert_equal 'hello', data
|
186
185
|
|
187
|
-
|
186
|
+
assert_path_not_exist path
|
188
187
|
end
|
189
188
|
|
190
189
|
def util_fuck_with_fetcher(data, blow = false)
|
@@ -390,7 +389,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
390
389
|
def test_download_unsupported
|
391
390
|
inst = Gem::RemoteFetcher.fetcher
|
392
391
|
|
393
|
-
e =
|
392
|
+
e = assert_raise ArgumentError do
|
394
393
|
inst.download @a1, 'ftp://gems.rubyforge.org'
|
395
394
|
end
|
396
395
|
|
@@ -451,7 +450,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
451
450
|
|
452
451
|
url = 'http://example.com/uri'
|
453
452
|
|
454
|
-
e =
|
453
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
455
454
|
fetcher.fetch_path url
|
456
455
|
end
|
457
456
|
|
@@ -469,7 +468,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
469
468
|
|
470
469
|
url = 'http://example.com/uri'
|
471
470
|
|
472
|
-
e =
|
471
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
473
472
|
fetcher.fetch_path url
|
474
473
|
end
|
475
474
|
|
@@ -487,7 +486,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
487
486
|
|
488
487
|
url = 'http://example.com/uri'
|
489
488
|
|
490
|
-
e =
|
489
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
491
490
|
fetcher.fetch_path url
|
492
491
|
end
|
493
492
|
|
@@ -506,7 +505,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
506
505
|
|
507
506
|
url = 'http://example.com/uri'
|
508
507
|
|
509
|
-
e =
|
508
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
510
509
|
fetcher.fetch_path url
|
511
510
|
end
|
512
511
|
|
@@ -525,7 +524,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
525
524
|
|
526
525
|
url = 'http://example.com/uri'
|
527
526
|
|
528
|
-
e =
|
527
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
529
528
|
fetcher.fetch_path url
|
530
529
|
end
|
531
530
|
|
@@ -544,7 +543,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
544
543
|
|
545
544
|
url = 'http://example.com/uri'
|
546
545
|
|
547
|
-
e =
|
546
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
548
547
|
fetcher.fetch_path url
|
549
548
|
end
|
550
549
|
|
@@ -634,7 +633,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
634
633
|
res
|
635
634
|
end
|
636
635
|
|
637
|
-
e =
|
636
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
638
637
|
fetcher.fetch_http URI.parse(url)
|
639
638
|
end
|
640
639
|
|
@@ -651,7 +650,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
651
650
|
res
|
652
651
|
end
|
653
652
|
|
654
|
-
e =
|
653
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
655
654
|
fetcher.fetch_http URI.parse(url)
|
656
655
|
end
|
657
656
|
|
@@ -836,7 +835,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
836
835
|
fetcher = Gem::RemoteFetcher.new nil
|
837
836
|
@fetcher = fetcher
|
838
837
|
|
839
|
-
e =
|
838
|
+
e = assert_raise Gem::RemoteFetcher::FetchError do
|
840
839
|
fetcher.fetch_s3 URI.parse(url)
|
841
840
|
end
|
842
841
|
|
@@ -952,7 +951,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
952
951
|
with_configured_fetcher(
|
953
952
|
":ssl_ca_cert: #{temp_ca_cert}\n" +
|
954
953
|
":ssl_client_cert: #{temp_client_cert}\n") do |fetcher|
|
955
|
-
|
954
|
+
assert_raise Gem::RemoteFetcher::FetchError do
|
956
955
|
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
|
957
956
|
end
|
958
957
|
end
|
@@ -961,7 +960,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
961
960
|
def test_do_not_allow_insecure_ssl_connection_by_default
|
962
961
|
ssl_server = start_ssl_server
|
963
962
|
with_configured_fetcher do |fetcher|
|
964
|
-
|
963
|
+
assert_raise Gem::RemoteFetcher::FetchError do
|
965
964
|
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/yaml")
|
966
965
|
end
|
967
966
|
end
|
@@ -981,7 +980,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
981
980
|
"redirecting to non-https resource: #{@server_uri} (https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri})"
|
982
981
|
|
983
982
|
with_configured_fetcher(":ssl_ca_cert: #{temp_ca_cert}") do |fetcher|
|
984
|
-
err =
|
983
|
+
err = assert_raise Gem::RemoteFetcher::FetchError do
|
985
984
|
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}/insecure_redirect?to=#{@server_uri}")
|
986
985
|
end
|
987
986
|
|
@@ -994,7 +993,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
994
993
|
temp_ca_cert = nil
|
995
994
|
|
996
995
|
with_configured_fetcher(":ssl_ca_cert: #{temp_ca_cert}") do |fetcher|
|
997
|
-
|
996
|
+
assert_raise Gem::RemoteFetcher::FetchError do
|
998
997
|
fetcher.fetch_path("https://localhost:#{ssl_server.config[:Port]}")
|
999
998
|
end
|
1000
999
|
end
|
@@ -1084,7 +1083,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
1084
1083
|
end
|
1085
1084
|
|
1086
1085
|
def start_ssl_server(config = {})
|
1087
|
-
|
1086
|
+
pend "starting this test server fails randomly on jruby" if Gem.java_platform?
|
1088
1087
|
|
1089
1088
|
null_logger = NilLog.new
|
1090
1089
|
server = WEBrick::HTTPServer.new({
|