rubygems-update 3.2.17 → 3.2.21
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -41,7 +41,7 @@ class TestGemSecuritySigner < Gem::TestCase
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_initialize_cert_chain_invalid
|
44
|
-
|
44
|
+
assert_raise OpenSSL::X509::CertificateError do
|
45
45
|
Gem::Security::Signer.new nil, ['garbage']
|
46
46
|
end
|
47
47
|
end
|
@@ -134,7 +134,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|
134
134
|
def test_sign_expired
|
135
135
|
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
|
136
136
|
|
137
|
-
e =
|
137
|
+
e = assert_raise Gem::Security::Exception do
|
138
138
|
signer.sign 'hello'
|
139
139
|
end
|
140
140
|
|
@@ -142,7 +142,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def test_sign_expired_auto_update
|
145
|
-
|
145
|
+
pend if Gem.java_platform?
|
146
146
|
FileUtils.mkdir_p File.join(Gem.user_home, '.gem'), :mode => 0700
|
147
147
|
|
148
148
|
private_key_path = File.join(Gem.user_home, '.gem', 'gem-private_key.pem')
|
@@ -165,7 +165,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|
165
165
|
expired_path =
|
166
166
|
File.join Gem.user_home, '.gem', "gem-public_cert.pem.expired.#{expiry}"
|
167
167
|
|
168
|
-
|
168
|
+
assert_path_exist expired_path
|
169
169
|
assert_equal EXPIRED_CERT.to_pem, File.read(expired_path)
|
170
170
|
end
|
171
171
|
|
@@ -186,7 +186,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|
186
186
|
|
187
187
|
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
|
188
188
|
|
189
|
-
e =
|
189
|
+
e = assert_raise Gem::Security::Exception do
|
190
190
|
signer.sign 'hello'
|
191
191
|
end
|
192
192
|
|
@@ -202,7 +202,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|
202
202
|
def test_sign_wrong_key
|
203
203
|
signer = Gem::Security::Signer.new ALTERNATE_KEY, [PUBLIC_CERT]
|
204
204
|
|
205
|
-
|
205
|
+
assert_raise Gem::Security::Exception do
|
206
206
|
signer.sign 'hello'
|
207
207
|
end
|
208
208
|
end
|
@@ -210,7 +210,7 @@ toqvglr0kdbknSRRjBVLK6tsgr07aLT9gNP7mTW2PA==
|
|
210
210
|
def test_sign_no_certs
|
211
211
|
signer = Gem::Security::Signer.new ALTERNATE_KEY, []
|
212
212
|
|
213
|
-
|
213
|
+
assert_raise Gem::Security::Exception do
|
214
214
|
signer.sign 'hello'
|
215
215
|
end
|
216
216
|
end
|
@@ -53,7 +53,7 @@ class TestGemSecurityTrustDir < Gem::TestCase
|
|
53
53
|
|
54
54
|
trusted = @trust_dir.cert_path PUBLIC_CERT
|
55
55
|
|
56
|
-
|
56
|
+
assert_path_exist trusted
|
57
57
|
|
58
58
|
mask = 0100600 & (~File.umask)
|
59
59
|
|
@@ -63,11 +63,11 @@ class TestGemSecurityTrustDir < Gem::TestCase
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def test_verify
|
66
|
-
|
66
|
+
assert_path_not_exist @dest_dir
|
67
67
|
|
68
68
|
@trust_dir.verify
|
69
69
|
|
70
|
-
|
70
|
+
assert_path_exist @dest_dir
|
71
71
|
|
72
72
|
mask = 040700 & (~File.umask)
|
73
73
|
mask |= 0200000 if /aix/ =~ RUBY_PLATFORM
|
@@ -78,7 +78,7 @@ class TestGemSecurityTrustDir < Gem::TestCase
|
|
78
78
|
def test_verify_file
|
79
79
|
FileUtils.touch @dest_dir
|
80
80
|
|
81
|
-
e =
|
81
|
+
e = assert_raise Gem::Security::Exception do
|
82
82
|
@trust_dir.verify
|
83
83
|
end
|
84
84
|
|
@@ -133,7 +133,7 @@ class TestGemServer < Gem::TestCase
|
|
133
133
|
def test_listen
|
134
134
|
util_listen
|
135
135
|
|
136
|
-
|
136
|
+
capture_output do
|
137
137
|
@server.listen
|
138
138
|
end
|
139
139
|
|
@@ -143,7 +143,7 @@ class TestGemServer < Gem::TestCase
|
|
143
143
|
def test_listen_addresses
|
144
144
|
util_listen
|
145
145
|
|
146
|
-
|
146
|
+
capture_output do
|
147
147
|
@server.listen %w[a b]
|
148
148
|
end
|
149
149
|
|
@@ -16,7 +16,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
16
16
|
|
17
17
|
def test_ask
|
18
18
|
value = nil
|
19
|
-
out, err =
|
19
|
+
out, err = capture_output do
|
20
20
|
use_ui @sui do
|
21
21
|
value = @sui.ask 'Problem?'
|
22
22
|
end
|
@@ -30,7 +30,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
30
30
|
|
31
31
|
def test_ask_for_password
|
32
32
|
value = nil
|
33
|
-
out, err =
|
33
|
+
out, err = capture_output do
|
34
34
|
use_ui @sui do
|
35
35
|
value = @sui.ask_for_password 'Problem?'
|
36
36
|
end
|
@@ -44,9 +44,9 @@ class TestGemSilentUI < Gem::TestCase
|
|
44
44
|
|
45
45
|
def test_ask_yes_no
|
46
46
|
value = nil
|
47
|
-
out, err =
|
47
|
+
out, err = capture_output do
|
48
48
|
use_ui @sui do
|
49
|
-
|
49
|
+
assert_raise(Gem::OperationNotSupportedError) do
|
50
50
|
@sui.ask_yes_no 'Problem?'
|
51
51
|
end
|
52
52
|
end
|
@@ -55,7 +55,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
55
55
|
assert_empty out, 'No output'
|
56
56
|
assert_empty err, 'No output'
|
57
57
|
|
58
|
-
out, err =
|
58
|
+
out, err = capture_output do
|
59
59
|
use_ui @sui do
|
60
60
|
value = @sui.ask_yes_no 'Problem?', true
|
61
61
|
end
|
@@ -66,7 +66,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
66
66
|
|
67
67
|
assert value, 'Value is true'
|
68
68
|
|
69
|
-
out, err =
|
69
|
+
out, err = capture_output do
|
70
70
|
use_ui @sui do
|
71
71
|
value = @sui.ask_yes_no 'Problem?', false
|
72
72
|
end
|
@@ -80,7 +80,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
80
80
|
|
81
81
|
def test_choose_from_list
|
82
82
|
value = nil
|
83
|
-
out, err =
|
83
|
+
out, err = capture_output do
|
84
84
|
use_ui @sui do
|
85
85
|
value = @sui.choose_from_list 'Problem?', %w[yes no]
|
86
86
|
end
|
@@ -93,7 +93,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def test_progress_reporter
|
96
|
-
out, err =
|
96
|
+
out, err = capture_output do
|
97
97
|
use_ui @sui do
|
98
98
|
@sui.progress_reporter 10, 'hi'
|
99
99
|
end
|
@@ -104,7 +104,7 @@ class TestGemSilentUI < Gem::TestCase
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def test_download_reporter
|
107
|
-
out, err =
|
107
|
+
out, err = capture_output do
|
108
108
|
use_ui @sui do
|
109
109
|
@sui.download_reporter.fetch 'a.gem', 1024
|
110
110
|
end
|
@@ -22,7 +22,7 @@ class TestGemSource < Gem::TestCase
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_initialize_invalid_uri
|
25
|
-
|
25
|
+
assert_raise URI::InvalidURIError do
|
26
26
|
Gem::Source.new 'git@example:a.git'
|
27
27
|
end
|
28
28
|
end
|
@@ -185,7 +185,7 @@ class TestGemSource < Gem::TestCase
|
|
185
185
|
def test_load_specs_from_unavailable_uri
|
186
186
|
src = Gem::Source.new("http://not-there.nothing")
|
187
187
|
|
188
|
-
|
188
|
+
assert_raise Gem::RemoteFetcher::FetchError do
|
189
189
|
src.load_specs :latest
|
190
190
|
end
|
191
191
|
end
|
@@ -24,7 +24,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
24
24
|
def test_checkout
|
25
25
|
@source.checkout
|
26
26
|
|
27
|
-
|
27
|
+
assert_path_exist File.join @source.install_dir, 'a.gemspec'
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_checkout_master
|
@@ -39,7 +39,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
39
39
|
|
40
40
|
@source.checkout
|
41
41
|
|
42
|
-
|
42
|
+
assert_path_exist File.join @source.install_dir, 'b.gemspec'
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_checkout_local
|
@@ -49,7 +49,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
49
49
|
|
50
50
|
install_dir = File.join Gem.dir, 'bundler', 'gems', "a-#{@head[0..11]}"
|
51
51
|
|
52
|
-
|
52
|
+
assert_path_not_exist File.join install_dir, 'a.gemspec'
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_checkout_local_cached
|
@@ -59,7 +59,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
59
59
|
|
60
60
|
@source.checkout
|
61
61
|
|
62
|
-
|
62
|
+
assert_path_exist File.join @source.install_dir, 'a.gemspec'
|
63
63
|
end
|
64
64
|
|
65
65
|
def test_checkout_submodules
|
@@ -76,14 +76,14 @@ class TestGemSourceGit < Gem::TestCase
|
|
76
76
|
|
77
77
|
source.checkout
|
78
78
|
|
79
|
-
|
80
|
-
|
79
|
+
assert_path_exist File.join source.install_dir, 'a.gemspec'
|
80
|
+
assert_path_exist File.join source.install_dir, 'b/b.gemspec'
|
81
81
|
end
|
82
82
|
|
83
83
|
def test_cache
|
84
84
|
assert @source.cache
|
85
85
|
|
86
|
-
|
86
|
+
assert_path_exist @source.repo_cache_dir
|
87
87
|
|
88
88
|
Dir.chdir @source.repo_cache_dir do
|
89
89
|
assert_equal @head, Gem::Util.popen(@git, 'rev-parse', 'master').strip
|
@@ -95,7 +95,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
95
95
|
|
96
96
|
@source.cache
|
97
97
|
|
98
|
-
|
98
|
+
assert_path_not_exist @source.repo_cache_dir
|
99
99
|
end
|
100
100
|
|
101
101
|
def test_dir_shortref
|
@@ -186,7 +186,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
186
186
|
|
187
187
|
source.cache
|
188
188
|
|
189
|
-
e =
|
189
|
+
e = assert_raise Gem::Exception do
|
190
190
|
capture_subprocess_io { source.rev_parse }
|
191
191
|
end
|
192
192
|
|
@@ -240,7 +240,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
240
240
|
|
241
241
|
specs = nil
|
242
242
|
|
243
|
-
|
243
|
+
capture_output do
|
244
244
|
specs = source.specs
|
245
245
|
end
|
246
246
|
|
@@ -275,7 +275,7 @@ class TestGemSourceGit < Gem::TestCase
|
|
275
275
|
source = Gem::Source::Git.new @name, @repository, 'master', true
|
276
276
|
source.remote = false
|
277
277
|
|
278
|
-
|
278
|
+
capture_output do
|
279
279
|
assert_empty source.specs
|
280
280
|
end
|
281
281
|
end
|
@@ -170,7 +170,7 @@ end
|
|
170
170
|
base.activate
|
171
171
|
|
172
172
|
tms = Benchmark.measure do
|
173
|
-
|
173
|
+
assert_raise(LoadError) { require 'no_such_file_foo' }
|
174
174
|
end
|
175
175
|
assert_operator tms.total, :<=, 10
|
176
176
|
end
|
@@ -406,7 +406,7 @@ end
|
|
406
406
|
c = util_spec 'c', '1.0', 'b' => '= 2.0'
|
407
407
|
install_specs b1, b2, c, a
|
408
408
|
|
409
|
-
e =
|
409
|
+
e = assert_raise Gem::LoadError do
|
410
410
|
assert_activate nil, a, c, "b"
|
411
411
|
end
|
412
412
|
|
@@ -428,7 +428,7 @@ end
|
|
428
428
|
|
429
429
|
install_specs b1, b2, c, a
|
430
430
|
|
431
|
-
e =
|
431
|
+
e = assert_raise Gem::ConflictError do
|
432
432
|
assert_activate nil, a, c, "b"
|
433
433
|
end
|
434
434
|
|
@@ -537,7 +537,7 @@ end
|
|
537
537
|
|
538
538
|
require "b#{$$}"
|
539
539
|
|
540
|
-
e =
|
540
|
+
e = assert_raise Gem::LoadError do
|
541
541
|
require "d#{$$}"
|
542
542
|
end
|
543
543
|
|
@@ -673,7 +673,7 @@ end
|
|
673
673
|
|
674
674
|
gem "b", "= 1.0"
|
675
675
|
|
676
|
-
|
676
|
+
assert_raise Gem::LoadError do
|
677
677
|
gem "b", "= 2.0"
|
678
678
|
end
|
679
679
|
end
|
@@ -973,7 +973,7 @@ dependencies: []
|
|
973
973
|
io.write @a2.to_ruby_for_cache
|
974
974
|
end
|
975
975
|
rescue Errno::EINVAL
|
976
|
-
|
976
|
+
pend "cannot create '#{full_path}' on this platform"
|
977
977
|
end
|
978
978
|
|
979
979
|
spec = Gem::Specification.load full_path
|
@@ -992,7 +992,7 @@ dependencies: []
|
|
992
992
|
io.write @a2.to_ruby_for_cache
|
993
993
|
end
|
994
994
|
rescue Errno::EINVAL
|
995
|
-
|
995
|
+
pend "cannot create '#{full_path}' on this platform"
|
996
996
|
end
|
997
997
|
|
998
998
|
spec = Gem::Specification.load full_path
|
@@ -1011,7 +1011,7 @@ dependencies: []
|
|
1011
1011
|
io.write @a2.to_ruby_for_cache
|
1012
1012
|
end
|
1013
1013
|
rescue Errno::EINVAL
|
1014
|
-
|
1014
|
+
pend "cannot create '#{full_path}' on this platform"
|
1015
1015
|
end
|
1016
1016
|
|
1017
1017
|
spec = Gem::Specification.load full_path
|
@@ -1345,7 +1345,7 @@ dependencies: []
|
|
1345
1345
|
spec.instance_variable_set :@licenses, (class << (Object.new);self;end)
|
1346
1346
|
spec.loaded_from = '/path/to/file'
|
1347
1347
|
|
1348
|
-
e =
|
1348
|
+
e = assert_raise Gem::FormatException do
|
1349
1349
|
spec.dup
|
1350
1350
|
end
|
1351
1351
|
|
@@ -1451,7 +1451,7 @@ dependencies: []
|
|
1451
1451
|
end
|
1452
1452
|
|
1453
1453
|
def test_build_args
|
1454
|
-
|
1454
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1455
1455
|
ext_spec
|
1456
1456
|
|
1457
1457
|
assert_empty @ext.build_args
|
@@ -1470,10 +1470,10 @@ dependencies: []
|
|
1470
1470
|
end
|
1471
1471
|
|
1472
1472
|
def test_build_extensions
|
1473
|
-
|
1473
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1474
1474
|
ext_spec
|
1475
1475
|
|
1476
|
-
|
1476
|
+
assert_path_not_exist @ext.extension_dir, 'sanity check'
|
1477
1477
|
refute_empty @ext.extensions, 'sanity check'
|
1478
1478
|
|
1479
1479
|
extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
|
@@ -1491,7 +1491,7 @@ dependencies: []
|
|
1491
1491
|
|
1492
1492
|
@ext.build_extensions
|
1493
1493
|
|
1494
|
-
|
1494
|
+
assert_path_exist @ext.extension_dir
|
1495
1495
|
end
|
1496
1496
|
|
1497
1497
|
def test_default_spec_stub_is_marked_default
|
@@ -1506,7 +1506,7 @@ dependencies: []
|
|
1506
1506
|
end
|
1507
1507
|
|
1508
1508
|
def test_build_extensions_built
|
1509
|
-
|
1509
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1510
1510
|
ext_spec
|
1511
1511
|
|
1512
1512
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1520,7 +1520,7 @@ dependencies: []
|
|
1520
1520
|
@ext.build_extensions
|
1521
1521
|
|
1522
1522
|
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
|
1523
|
-
|
1523
|
+
assert_path_not_exist gem_make_out
|
1524
1524
|
end
|
1525
1525
|
|
1526
1526
|
def test_build_extensions_default_gem
|
@@ -1541,25 +1541,25 @@ dependencies: []
|
|
1541
1541
|
|
1542
1542
|
spec.build_extensions
|
1543
1543
|
|
1544
|
-
|
1544
|
+
assert_path_not_exist spec.extension_dir
|
1545
1545
|
end
|
1546
1546
|
|
1547
1547
|
def test_build_extensions_error
|
1548
|
-
|
1548
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1549
1549
|
ext_spec
|
1550
1550
|
|
1551
1551
|
refute_empty @ext.extensions, 'sanity check'
|
1552
1552
|
|
1553
|
-
|
1553
|
+
assert_raise Gem::Ext::BuildError do
|
1554
1554
|
@ext.build_extensions
|
1555
1555
|
end
|
1556
1556
|
end
|
1557
1557
|
|
1558
1558
|
def test_build_extensions_extensions_dir_unwritable
|
1559
|
-
|
1560
|
-
|
1559
|
+
pend 'chmod not supported' if Gem.win_platform?
|
1560
|
+
pend 'skipped in root privilege' if Process.uid.zero?
|
1561
1561
|
|
1562
|
-
|
1562
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1563
1563
|
ext_spec
|
1564
1564
|
|
1565
1565
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1582,7 +1582,7 @@ dependencies: []
|
|
1582
1582
|
FileUtils.chmod 0555, File.join(@ext.base_dir, 'extensions')
|
1583
1583
|
|
1584
1584
|
@ext.build_extensions
|
1585
|
-
|
1585
|
+
assert_path_not_exist @ext.extension_dir
|
1586
1586
|
ensure
|
1587
1587
|
unless ($DEBUG or win_platform? or Process.uid.zero? or Gem.java_platform?)
|
1588
1588
|
FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions')
|
@@ -1591,8 +1591,8 @@ dependencies: []
|
|
1591
1591
|
end
|
1592
1592
|
|
1593
1593
|
def test_build_extensions_no_extensions_dir_unwritable
|
1594
|
-
|
1595
|
-
|
1594
|
+
pend 'chmod not supported' if Gem.win_platform?
|
1595
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1596
1596
|
ext_spec
|
1597
1597
|
|
1598
1598
|
refute_empty @ext.extensions, 'sanity check'
|
@@ -1616,36 +1616,22 @@ dependencies: []
|
|
1616
1616
|
@ext.build_extensions
|
1617
1617
|
|
1618
1618
|
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
|
1619
|
-
|
1619
|
+
assert_path_not_exist gem_make_out
|
1620
1620
|
ensure
|
1621
1621
|
FileUtils.chmod 0755, @gemhome
|
1622
1622
|
end
|
1623
1623
|
|
1624
1624
|
def test_build_extensions_none
|
1625
|
-
|
1625
|
+
assert_path_not_exist @a1.extension_dir, 'sanity check'
|
1626
1626
|
assert_empty @a1.extensions, 'sanity check'
|
1627
1627
|
|
1628
1628
|
@a1.build_extensions
|
1629
1629
|
|
1630
|
-
|
1631
|
-
end
|
1632
|
-
|
1633
|
-
def test_build_extensions_old
|
1634
|
-
skip "extensions don't quite work on jruby" if Gem.java_platform?
|
1635
|
-
ext_spec
|
1636
|
-
|
1637
|
-
refute_empty @ext.extensions, 'sanity check'
|
1638
|
-
|
1639
|
-
@ext.installed_by_version = v(0)
|
1640
|
-
|
1641
|
-
@ext.build_extensions
|
1642
|
-
|
1643
|
-
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
|
1644
|
-
refute_path_exists gem_make_out
|
1630
|
+
assert_path_not_exist @a1.extension_dir
|
1645
1631
|
end
|
1646
1632
|
|
1647
1633
|
def test_build_extensions_preview
|
1648
|
-
|
1634
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1649
1635
|
ext_spec
|
1650
1636
|
|
1651
1637
|
extconf_rb = File.join @ext.gem_dir, @ext.extensions.first
|
@@ -1668,7 +1654,7 @@ dependencies: []
|
|
1668
1654
|
@ext.build_extensions
|
1669
1655
|
|
1670
1656
|
gem_make_out = File.join @ext.extension_dir, 'gem_make.out'
|
1671
|
-
|
1657
|
+
assert_path_exist gem_make_out
|
1672
1658
|
end
|
1673
1659
|
|
1674
1660
|
def test_contains_requirable_file_eh
|
@@ -1680,10 +1666,10 @@ dependencies: []
|
|
1680
1666
|
end
|
1681
1667
|
|
1682
1668
|
def test_contains_requirable_file_eh_extension
|
1683
|
-
|
1669
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
1684
1670
|
ext_spec
|
1685
1671
|
|
1686
|
-
_, err =
|
1672
|
+
_, err = capture_output do
|
1687
1673
|
refute @ext.contains_requirable_file? 'nonexistent'
|
1688
1674
|
end
|
1689
1675
|
|
@@ -1696,7 +1682,7 @@ dependencies: []
|
|
1696
1682
|
def test_contains_requirable_file_eh_extension_java_platform
|
1697
1683
|
ext_spec(platform: Gem::Platform.new("java"))
|
1698
1684
|
|
1699
|
-
_, err =
|
1685
|
+
_, err = capture_output do
|
1700
1686
|
refute @ext.contains_requirable_file? 'nonexistent'
|
1701
1687
|
end
|
1702
1688
|
|
@@ -1718,7 +1704,7 @@ dependencies: []
|
|
1718
1704
|
end
|
1719
1705
|
|
1720
1706
|
def test_date_equals_string_bad
|
1721
|
-
|
1707
|
+
assert_raise Gem::InvalidSpecificationException do
|
1722
1708
|
@a1.date = '9/11/2003'
|
1723
1709
|
end
|
1724
1710
|
end
|
@@ -2449,7 +2435,7 @@ end
|
|
2449
2435
|
|
2450
2436
|
def test_to_ruby_with_rsa_key
|
2451
2437
|
require 'rubygems/openssl'
|
2452
|
-
|
2438
|
+
pend 'openssl is missing' unless defined?(OpenSSL::PKey::RSA)
|
2453
2439
|
|
2454
2440
|
rsa_key = OpenSSL::PKey::RSA.new(2048)
|
2455
2441
|
@a2.signing_key = rsa_key
|
@@ -2633,7 +2619,7 @@ end
|
|
2633
2619
|
def test_to_yaml
|
2634
2620
|
yaml_str = @a1.to_yaml
|
2635
2621
|
|
2636
|
-
refute_match
|
2622
|
+
refute_match %r{!!null}, yaml_str
|
2637
2623
|
|
2638
2624
|
same_spec = Gem::Specification.from_yaml(yaml_str)
|
2639
2625
|
|
@@ -2663,7 +2649,7 @@ end
|
|
2663
2649
|
|
2664
2650
|
yaml_str = @a1.to_yaml
|
2665
2651
|
|
2666
|
-
same_spec =
|
2652
|
+
same_spec = load_yaml yaml_str
|
2667
2653
|
|
2668
2654
|
assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
|
2669
2655
|
assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform
|
@@ -2704,7 +2690,7 @@ end
|
|
2704
2690
|
|
2705
2691
|
assert_equal [], @a1.authors
|
2706
2692
|
|
2707
|
-
e =
|
2693
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2708
2694
|
@a1.validate
|
2709
2695
|
end
|
2710
2696
|
|
@@ -2712,7 +2698,7 @@ end
|
|
2712
2698
|
|
2713
2699
|
@a1.authors = ["#{f} (who is writing this software)"]
|
2714
2700
|
|
2715
|
-
e =
|
2701
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2716
2702
|
@a1.validate
|
2717
2703
|
end
|
2718
2704
|
|
@@ -2720,7 +2706,7 @@ end
|
|
2720
2706
|
|
2721
2707
|
@a1.authors = ["#{t} (who is writing this software)"]
|
2722
2708
|
|
2723
|
-
e =
|
2709
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2724
2710
|
@a1.validate
|
2725
2711
|
end
|
2726
2712
|
|
@@ -2799,7 +2785,7 @@ end
|
|
2799
2785
|
@a1.add_development_dependency 'c', '>= 1.2.3'
|
2800
2786
|
|
2801
2787
|
use_ui @ui do
|
2802
|
-
e =
|
2788
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2803
2789
|
@a1.validate
|
2804
2790
|
end
|
2805
2791
|
|
@@ -2903,7 +2889,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2903
2889
|
|
2904
2890
|
@a1.description = "#{f} (describe your package)"
|
2905
2891
|
|
2906
|
-
e =
|
2892
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2907
2893
|
@a1.validate
|
2908
2894
|
end
|
2909
2895
|
|
@@ -2911,7 +2897,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2911
2897
|
|
2912
2898
|
@a1.description = "#{t} (describe your package)"
|
2913
2899
|
|
2914
|
-
e =
|
2900
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2915
2901
|
@a1.validate
|
2916
2902
|
end
|
2917
2903
|
|
@@ -2925,7 +2911,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2925
2911
|
Dir.chdir @tempdir do
|
2926
2912
|
@a1.email = "FIxxxXME (your e-mail)".sub(/xxx/, "")
|
2927
2913
|
|
2928
|
-
e =
|
2914
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2929
2915
|
@a1.validate
|
2930
2916
|
end
|
2931
2917
|
|
@@ -2933,7 +2919,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2933
2919
|
|
2934
2920
|
@a1.email = "#{t} (your e-mail)"
|
2935
2921
|
|
2936
|
-
e =
|
2922
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2937
2923
|
@a1.validate
|
2938
2924
|
end
|
2939
2925
|
|
@@ -2942,7 +2928,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2942
2928
|
end
|
2943
2929
|
|
2944
2930
|
def test_validate_empty
|
2945
|
-
e =
|
2931
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2946
2932
|
Gem::Specification.new.validate
|
2947
2933
|
end
|
2948
2934
|
|
@@ -2950,7 +2936,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2950
2936
|
end
|
2951
2937
|
|
2952
2938
|
def test_validate_error
|
2953
|
-
|
2939
|
+
assert_raise Gem::InvalidSpecificationException do
|
2954
2940
|
use_ui @ui do
|
2955
2941
|
Gem::Specification.new.validate
|
2956
2942
|
end
|
@@ -2980,12 +2966,12 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2980
2966
|
|
2981
2967
|
def test_validate_empty_require_paths
|
2982
2968
|
if win_platform?
|
2983
|
-
|
2969
|
+
pend 'test_validate_empty_require_paths skipped on MS Windows (symlink)'
|
2984
2970
|
else
|
2985
2971
|
util_setup_validate
|
2986
2972
|
|
2987
2973
|
@a1.require_paths = []
|
2988
|
-
e =
|
2974
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
2989
2975
|
@a1.validate
|
2990
2976
|
end
|
2991
2977
|
|
@@ -2995,7 +2981,7 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
|
|
2995
2981
|
end
|
2996
2982
|
|
2997
2983
|
def test_validate_files
|
2998
|
-
|
2984
|
+
pend 'test_validate_files skipped on MS Windows (symlink)' if win_platform?
|
2999
2985
|
util_setup_validate
|
3000
2986
|
|
3001
2987
|
@a1.files += ['lib', 'lib2']
|
@@ -3035,9 +3021,11 @@ WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
|
|
3035
3021
|
Please report a bug if this causes problems.
|
3036
3022
|
EXPECTED
|
3037
3023
|
|
3038
|
-
|
3024
|
+
actual_stdout, actual_stderr = capture_output do
|
3039
3025
|
specification.reset
|
3040
3026
|
end
|
3027
|
+
assert_empty actual_stdout
|
3028
|
+
assert_equal(expected, actual_stderr)
|
3041
3029
|
end
|
3042
3030
|
|
3043
3031
|
def test_unresolved_specs_with_versions
|
@@ -3066,16 +3054,20 @@ WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
|
|
3066
3054
|
Please report a bug if this causes problems.
|
3067
3055
|
EXPECTED
|
3068
3056
|
|
3069
|
-
|
3057
|
+
actual_stdout, actual_stderr = capture_output do
|
3070
3058
|
specification.reset
|
3071
3059
|
end
|
3060
|
+
assert_empty actual_stdout
|
3061
|
+
assert_equal(expected, actual_stderr)
|
3072
3062
|
end
|
3073
3063
|
|
3074
3064
|
def test_duplicate_runtime_dependency
|
3075
3065
|
expected = "WARNING: duplicated b dependency [\"~> 3.0\", \"~> 3.0\"]\n"
|
3076
|
-
|
3066
|
+
out, err = capture_output do
|
3077
3067
|
@a1.add_runtime_dependency "b", "~> 3.0", "~> 3.0"
|
3078
3068
|
end
|
3069
|
+
assert_empty out
|
3070
|
+
assert_equal(expected, err)
|
3079
3071
|
end
|
3080
3072
|
|
3081
3073
|
def set_orig(cls)
|
@@ -3090,7 +3082,7 @@ Please report a bug if this causes problems.
|
|
3090
3082
|
|
3091
3083
|
@a1.files = [@a1.file_name]
|
3092
3084
|
|
3093
|
-
e =
|
3085
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3094
3086
|
@a1.validate
|
3095
3087
|
end
|
3096
3088
|
|
@@ -3122,7 +3114,7 @@ Please report a bug if this causes problems.
|
|
3122
3114
|
|
3123
3115
|
@a1.homepage = 'over at my cool site'
|
3124
3116
|
|
3125
|
-
e =
|
3117
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3126
3118
|
@a1.validate
|
3127
3119
|
end
|
3128
3120
|
|
@@ -3130,7 +3122,7 @@ Please report a bug if this causes problems.
|
|
3130
3122
|
|
3131
3123
|
@a1.homepage = 'ftp://rubygems.org'
|
3132
3124
|
|
3133
|
-
e =
|
3125
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3134
3126
|
@a1.validate
|
3135
3127
|
end
|
3136
3128
|
|
@@ -3319,7 +3311,7 @@ Did you mean 'Ruby'?
|
|
3319
3311
|
def test_validate_name
|
3320
3312
|
util_setup_validate
|
3321
3313
|
|
3322
|
-
e =
|
3314
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3323
3315
|
@a1.name = :json
|
3324
3316
|
@a1.validate
|
3325
3317
|
end
|
@@ -3327,31 +3319,31 @@ Did you mean 'Ruby'?
|
|
3327
3319
|
assert_equal 'invalid value for attribute name: ":json" must be a string', e.message
|
3328
3320
|
|
3329
3321
|
@a1.name = []
|
3330
|
-
e =
|
3322
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3331
3323
|
@a1.validate
|
3332
3324
|
end
|
3333
3325
|
assert_equal "invalid value for attribute name: \"[]\" must be a string", e.message
|
3334
3326
|
|
3335
3327
|
@a1.name = ""
|
3336
|
-
e =
|
3328
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3337
3329
|
@a1.validate
|
3338
3330
|
end
|
3339
3331
|
assert_equal "invalid value for attribute name: \"\" must include at least one letter", e.message
|
3340
3332
|
|
3341
3333
|
@a1.name = "12345"
|
3342
|
-
e =
|
3334
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3343
3335
|
@a1.validate
|
3344
3336
|
end
|
3345
3337
|
assert_equal "invalid value for attribute name: \"12345\" must include at least one letter", e.message
|
3346
3338
|
|
3347
3339
|
@a1.name = "../malicious"
|
3348
|
-
e =
|
3340
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3349
3341
|
@a1.validate
|
3350
3342
|
end
|
3351
3343
|
assert_equal "invalid value for attribute name: \"../malicious\" can only include letters, numbers, dashes, and underscores", e.message
|
3352
3344
|
|
3353
3345
|
@a1.name = "\ba\t"
|
3354
|
-
e =
|
3346
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3355
3347
|
@a1.validate
|
3356
3348
|
end
|
3357
3349
|
assert_equal "invalid value for attribute name: \"\\ba\\t\" can only include letters, numbers, dashes, and underscores", e.message
|
@@ -3368,7 +3360,7 @@ Did you mean 'Ruby'?
|
|
3368
3360
|
spec = @a1.dup
|
3369
3361
|
spec.instance_variable_set "@#{name}", nil
|
3370
3362
|
|
3371
|
-
e =
|
3363
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3372
3364
|
spec.validate
|
3373
3365
|
end
|
3374
3366
|
|
@@ -3378,7 +3370,7 @@ Did you mean 'Ruby'?
|
|
3378
3370
|
end
|
3379
3371
|
|
3380
3372
|
def test_validate_permissions
|
3381
|
-
|
3373
|
+
pend 'chmod not supported' if Gem.win_platform?
|
3382
3374
|
|
3383
3375
|
util_setup_validate
|
3384
3376
|
|
@@ -3397,7 +3389,7 @@ Did you mean 'Ruby'?
|
|
3397
3389
|
end
|
3398
3390
|
|
3399
3391
|
def test_validate_permissions_of_missing_file_non_packaging
|
3400
|
-
|
3392
|
+
pend 'chmod not supported' if Gem.win_platform?
|
3401
3393
|
|
3402
3394
|
util_setup_validate
|
3403
3395
|
|
@@ -3429,7 +3421,7 @@ Did you mean 'Ruby'?
|
|
3429
3421
|
util_setup_validate
|
3430
3422
|
|
3431
3423
|
@a1.rubygems_version = "3"
|
3432
|
-
e =
|
3424
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3433
3425
|
@a1.validate
|
3434
3426
|
end
|
3435
3427
|
|
@@ -3443,7 +3435,7 @@ Did you mean 'Ruby'?
|
|
3443
3435
|
Dir.chdir @tempdir do
|
3444
3436
|
@a1.specification_version = '1.0'
|
3445
3437
|
|
3446
|
-
e =
|
3438
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3447
3439
|
use_ui @ui do
|
3448
3440
|
@a1.validate
|
3449
3441
|
end
|
@@ -3468,7 +3460,7 @@ Did you mean 'Ruby'?
|
|
3468
3460
|
|
3469
3461
|
@a1.summary = "#{f} (describe your package)"
|
3470
3462
|
|
3471
|
-
e =
|
3463
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3472
3464
|
@a1.validate
|
3473
3465
|
end
|
3474
3466
|
|
@@ -3476,7 +3468,7 @@ Did you mean 'Ruby'?
|
|
3476
3468
|
|
3477
3469
|
@a1.summary = "#{t} (describe your package)"
|
3478
3470
|
|
3479
|
-
e =
|
3471
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3480
3472
|
@a1.validate
|
3481
3473
|
end
|
3482
3474
|
|
@@ -3529,7 +3521,7 @@ Did you mean 'Ruby'?
|
|
3529
3521
|
specfile.write "raise 'boom'"
|
3530
3522
|
specfile.close
|
3531
3523
|
begin
|
3532
|
-
|
3524
|
+
capture_output do
|
3533
3525
|
Gem::Specification.load(specfile.path)
|
3534
3526
|
end
|
3535
3527
|
rescue => e
|
@@ -3599,7 +3591,7 @@ Did you mean 'Ruby'?
|
|
3599
3591
|
s.metadata = { 1 => "fail" }
|
3600
3592
|
end
|
3601
3593
|
|
3602
|
-
e =
|
3594
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3603
3595
|
@m2.validate
|
3604
3596
|
end
|
3605
3597
|
|
@@ -3616,11 +3608,11 @@ Did you mean 'Ruby'?
|
|
3616
3608
|
s.metadata = { ("x" * 129) => "fail" }
|
3617
3609
|
end
|
3618
3610
|
|
3619
|
-
e =
|
3611
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3620
3612
|
@m2.validate
|
3621
3613
|
end
|
3622
3614
|
|
3623
|
-
assert_equal "metadata key too large (129 > 128)", e.message
|
3615
|
+
assert_equal "metadata key is too large (129 > 128)", e.message
|
3624
3616
|
end
|
3625
3617
|
end
|
3626
3618
|
|
@@ -3633,11 +3625,11 @@ Did you mean 'Ruby'?
|
|
3633
3625
|
s.metadata = { 'fail' => [] }
|
3634
3626
|
end
|
3635
3627
|
|
3636
|
-
e =
|
3628
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3637
3629
|
@m2.validate
|
3638
3630
|
end
|
3639
3631
|
|
3640
|
-
assert_equal "metadata
|
3632
|
+
assert_equal "metadata['fail'] value must be a String", e.message
|
3641
3633
|
end
|
3642
3634
|
end
|
3643
3635
|
|
@@ -3650,11 +3642,11 @@ Did you mean 'Ruby'?
|
|
3650
3642
|
s.metadata = { 'fail' => ("x" * 1025) }
|
3651
3643
|
end
|
3652
3644
|
|
3653
|
-
e =
|
3645
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3654
3646
|
@m2.validate
|
3655
3647
|
end
|
3656
3648
|
|
3657
|
-
assert_equal "metadata value too large (1025 > 1024)", e.message
|
3649
|
+
assert_equal "metadata['fail'] value is too large (1025 > 1024)", e.message
|
3658
3650
|
end
|
3659
3651
|
end
|
3660
3652
|
|
@@ -3667,7 +3659,7 @@ Did you mean 'Ruby'?
|
|
3667
3659
|
s.metadata = { 'homepage_uri' => 'http:/example.com' }
|
3668
3660
|
end
|
3669
3661
|
|
3670
|
-
e =
|
3662
|
+
e = assert_raise Gem::InvalidSpecificationException do
|
3671
3663
|
@m2.validate
|
3672
3664
|
end
|
3673
3665
|
|
@@ -3707,7 +3699,7 @@ end
|
|
3707
3699
|
end
|
3708
3700
|
|
3709
3701
|
def test_missing_extensions_eh
|
3710
|
-
|
3702
|
+
pend "extensions don't quite work on jruby" if Gem.java_platform?
|
3711
3703
|
ext_spec
|
3712
3704
|
|
3713
3705
|
assert @ext.missing_extensions?
|
@@ -3737,18 +3729,6 @@ end
|
|
3737
3729
|
refute spec.missing_extensions?
|
3738
3730
|
end
|
3739
3731
|
|
3740
|
-
def test_missing_extensions_eh_legacy
|
3741
|
-
ext_spec
|
3742
|
-
|
3743
|
-
@ext.installed_by_version = v '2.2.0.preview.2'
|
3744
|
-
|
3745
|
-
assert @ext.missing_extensions?
|
3746
|
-
|
3747
|
-
@ext.installed_by_version = v '2.2.0.preview.1'
|
3748
|
-
|
3749
|
-
refute @ext.missing_extensions?
|
3750
|
-
end
|
3751
|
-
|
3752
3732
|
def test_missing_extensions_eh_none
|
3753
3733
|
refute @a1.missing_extensions?
|
3754
3734
|
end
|
@@ -3786,7 +3766,7 @@ end
|
|
3786
3766
|
assert Gem::Specification.find_by_name "a", "1"
|
3787
3767
|
assert Gem::Specification.find_by_name "a", ">1"
|
3788
3768
|
|
3789
|
-
|
3769
|
+
assert_raise Gem::MissingSpecError do
|
3790
3770
|
Gem::Specification.find_by_name "monkeys"
|
3791
3771
|
end
|
3792
3772
|
end
|
@@ -3807,7 +3787,7 @@ end
|
|
3807
3787
|
|
3808
3788
|
assert Gem::Specification.find_by_name "b"
|
3809
3789
|
|
3810
|
-
|
3790
|
+
assert_raise Gem::MissingSpecVersionError do
|
3811
3791
|
Gem::Specification.find_by_name "b", "1"
|
3812
3792
|
end
|
3813
3793
|
|