rubygems-update 2.1.11 → 2.2.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +37 -12
- data/History.txt +99 -2
- data/MIT.txt +1 -0
- data/Manifest.txt +59 -19
- data/Rakefile +4 -6
- data/lib/gauntlet_rubygems.rb +1 -1
- data/lib/rubygems.rb +102 -80
- data/lib/rubygems/available_set.rb +2 -2
- data/lib/rubygems/basic_specification.rb +97 -8
- data/lib/rubygems/commands/install_command.rb +58 -15
- data/lib/rubygems/commands/list_command.rb +1 -7
- data/lib/rubygems/commands/outdated_command.rb +1 -1
- data/lib/rubygems/commands/pristine_command.rb +14 -1
- data/lib/rubygems/commands/push_command.rb +9 -4
- data/lib/rubygems/commands/query_command.rb +33 -17
- data/lib/rubygems/commands/search_command.rb +0 -6
- data/lib/rubygems/commands/specification_command.rb +1 -1
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +4 -1
- data/lib/rubygems/commands/which_command.rb +5 -8
- data/lib/rubygems/compatibility.rb +3 -0
- data/lib/rubygems/core_ext/kernel_gem.rb +6 -0
- data/lib/rubygems/defaults.rb +19 -0
- data/lib/rubygems/dependency_installer.rb +28 -9
- data/lib/rubygems/doctor.rb +17 -11
- data/lib/rubygems/errors.rb +16 -3
- data/lib/rubygems/exceptions.rb +52 -5
- data/lib/rubygems/ext.rb +1 -2
- data/lib/rubygems/ext/build_error.rb +6 -0
- data/lib/rubygems/ext/builder.rb +50 -17
- data/lib/rubygems/ext/cmake_builder.rb +1 -1
- data/lib/rubygems/ext/configure_builder.rb +1 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -3
- data/lib/rubygems/ext/rake_builder.rb +2 -5
- data/lib/rubygems/gemcutter_utilities.rb +8 -1
- data/lib/rubygems/installer.rb +14 -4
- data/lib/rubygems/installer_test_case.rb +0 -5
- data/lib/rubygems/package.rb +11 -2
- data/lib/rubygems/psych_additions.rb +1 -1
- data/lib/rubygems/rdoc.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +3 -3
- data/lib/rubygems/request.rb +16 -8
- data/lib/rubygems/request_set.rb +133 -42
- data/lib/rubygems/request_set/gem_dependency_api.rb +493 -11
- data/lib/rubygems/request_set/lockfile.rb +579 -0
- data/lib/rubygems/requirement.rb +58 -30
- data/lib/rubygems/resolver.rb +471 -0
- data/lib/rubygems/resolver/activation_request.rb +165 -0
- data/lib/rubygems/resolver/api_set.rb +110 -0
- data/lib/rubygems/resolver/api_specification.rb +79 -0
- data/lib/rubygems/resolver/best_set.rb +31 -0
- data/lib/rubygems/resolver/composed_set.rb +39 -0
- data/lib/rubygems/resolver/conflict.rb +122 -0
- data/lib/rubygems/{dependency_resolver → resolver}/current_set.rb +1 -4
- data/lib/rubygems/{dependency_resolver → resolver}/dependency_request.rb +37 -7
- data/lib/rubygems/resolver/git_set.rb +119 -0
- data/lib/rubygems/resolver/git_specification.rb +35 -0
- data/lib/rubygems/resolver/index_set.rb +74 -0
- data/lib/rubygems/resolver/index_specification.rb +69 -0
- data/lib/rubygems/resolver/installed_specification.rb +40 -0
- data/lib/rubygems/{dependency_resolver → resolver}/installer_set.rb +18 -17
- data/lib/rubygems/resolver/local_specification.rb +16 -0
- data/lib/rubygems/resolver/lock_set.rb +78 -0
- data/lib/rubygems/resolver/lock_specification.rb +58 -0
- data/lib/rubygems/resolver/requirement_list.rb +81 -0
- data/lib/rubygems/resolver/set.rb +27 -0
- data/lib/rubygems/resolver/spec_specification.rb +58 -0
- data/lib/rubygems/resolver/specification.rb +89 -0
- data/lib/rubygems/resolver/stats.rb +44 -0
- data/lib/rubygems/resolver/vendor_set.rb +83 -0
- data/lib/rubygems/resolver/vendor_specification.rb +24 -0
- data/lib/rubygems/security/trust_dir.rb +16 -2
- data/lib/rubygems/source.rb +71 -18
- data/lib/rubygems/source/git.rb +218 -0
- data/lib/rubygems/source/installed.rb +8 -1
- data/lib/rubygems/source/local.rb +14 -8
- data/lib/rubygems/source/lock.rb +48 -0
- data/lib/rubygems/source/specific_file.rb +14 -3
- data/lib/rubygems/source/vendor.rb +27 -0
- data/lib/rubygems/source_list.rb +74 -12
- data/lib/rubygems/spec_fetcher.rb +36 -4
- data/lib/rubygems/specification.rb +214 -65
- data/lib/rubygems/stub_specification.rb +57 -1
- data/lib/rubygems/syck_hack.rb +3 -3
- data/lib/rubygems/test_case.rb +226 -59
- data/lib/rubygems/test_utilities.rb +198 -0
- data/lib/rubygems/uninstaller.rb +22 -10
- data/lib/rubygems/uri_formatter.rb +20 -0
- data/lib/rubygems/user_interaction.rb +193 -71
- data/lib/rubygems/util.rb +121 -0
- data/lib/rubygems/util/list.rb +4 -0
- data/lib/rubygems/util/stringio.rb +34 -0
- data/lib/rubygems/validator.rb +6 -2
- data/lib/rubygems/version.rb +4 -8
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_gem.rb +137 -29
- data/test/rubygems/test_gem_available_set.rb +19 -0
- data/test/rubygems/test_gem_commands_build_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +13 -13
- data/test/rubygems/test_gem_commands_dependency_command.rb +24 -34
- data/test/rubygems/test_gem_commands_fetch_command.rb +43 -48
- data/test/rubygems/test_gem_commands_install_command.rb +244 -279
- data/test/rubygems/test_gem_commands_list_command.rb +3 -3
- data/test/rubygems/test_gem_commands_outdated_command.rb +7 -12
- data/test/rubygems/test_gem_commands_pristine_command.rb +73 -27
- data/test/rubygems/test_gem_commands_push_command.rb +76 -8
- data/test/rubygems/test_gem_commands_query_command.rb +239 -49
- data/test/rubygems/test_gem_commands_sources_command.rb +10 -43
- data/test/rubygems/test_gem_commands_specification_command.rb +24 -47
- data/test/rubygems/test_gem_commands_stale_command.rb +2 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +3 -3
- data/test/rubygems/test_gem_commands_unpack_command.rb +16 -30
- data/test/rubygems/test_gem_commands_update_command.rb +149 -134
- data/test/rubygems/test_gem_commands_which_command.rb +4 -2
- data/test/rubygems/test_gem_dependency_installer.rb +68 -0
- data/test/rubygems/test_gem_dependency_list.rb +17 -17
- data/test/rubygems/test_gem_dependency_resolution_error.rb +28 -0
- data/test/rubygems/test_gem_doctor.rb +1 -1
- data/test/rubygems/test_gem_ext_builder.rb +178 -8
- data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -7
- data/test/rubygems/test_gem_ext_configure_builder.rb +8 -10
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +18 -21
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -3
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +10 -6
- data/test/rubygems/test_gem_indexer.rb +6 -6
- data/test/rubygems/test_gem_installer.rb +29 -10
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_package.rb +18 -0
- data/test/rubygems/test_gem_rdoc.rb +1 -1
- data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
- data/test/rubygems/test_gem_request.rb +37 -10
- data/test/rubygems/test_gem_request_set.rb +271 -9
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +684 -0
- data/test/rubygems/test_gem_request_set_lockfile.rb +849 -0
- data/test/rubygems/test_gem_requirement.rb +21 -0
- data/test/rubygems/{test_gem_dependency_resolver.rb → test_gem_resolver.rb} +231 -70
- data/test/rubygems/test_gem_resolver_activation_request.rb +63 -0
- data/test/rubygems/test_gem_resolver_api_set.rb +167 -0
- data/test/rubygems/test_gem_resolver_api_specification.rb +104 -0
- data/test/rubygems/test_gem_resolver_best_set.rb +30 -0
- data/test/rubygems/test_gem_resolver_conflict.rb +75 -0
- data/test/rubygems/test_gem_resolver_dependency_request.rb +20 -0
- data/test/rubygems/test_gem_resolver_git_set.rb +148 -0
- data/test/rubygems/test_gem_resolver_git_specification.rb +100 -0
- data/test/rubygems/test_gem_resolver_index_set.rb +28 -0
- data/test/rubygems/test_gem_resolver_index_specification.rb +89 -0
- data/test/rubygems/test_gem_resolver_installed_specification.rb +49 -0
- data/test/rubygems/test_gem_resolver_installer_set.rb +22 -0
- data/test/rubygems/test_gem_resolver_local_specification.rb +45 -0
- data/test/rubygems/test_gem_resolver_lock_set.rb +57 -0
- data/test/rubygems/test_gem_resolver_lock_specification.rb +87 -0
- data/test/rubygems/test_gem_resolver_requirement_list.rb +20 -0
- data/test/rubygems/test_gem_resolver_specification.rb +32 -0
- data/test/rubygems/test_gem_resolver_vendor_set.rb +67 -0
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +83 -0
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +54 -64
- data/test/rubygems/test_gem_source_git.rb +231 -0
- data/test/rubygems/test_gem_source_list.rb +24 -0
- data/test/rubygems/test_gem_source_local.rb +1 -1
- data/test/rubygems/test_gem_source_lock.rb +114 -0
- data/test/rubygems/test_gem_source_vendor.rb +27 -0
- data/test/rubygems/test_gem_spec_fetcher.rb +116 -61
- data/test/rubygems/test_gem_specification.rb +526 -94
- data/test/rubygems/test_gem_stub_specification.rb +123 -10
- data/test/rubygems/test_gem_uninstaller.rb +28 -2
- data/test/rubygems/test_gem_util.rb +31 -0
- data/test/rubygems/test_gem_validator.rb +9 -0
- data/util/update_bundled_ca_certificates.rb +8 -1
- metadata +89 -29
- metadata.gz.sig +2 -4
- data/lib/rubygems/dependency_resolver.rb +0 -254
- data/lib/rubygems/dependency_resolver/activation_request.rb +0 -109
- data/lib/rubygems/dependency_resolver/api_set.rb +0 -65
- data/lib/rubygems/dependency_resolver/api_specification.rb +0 -39
- data/lib/rubygems/dependency_resolver/composed_set.rb +0 -18
- data/lib/rubygems/dependency_resolver/dependency_conflict.rb +0 -85
- data/lib/rubygems/dependency_resolver/index_set.rb +0 -64
- data/lib/rubygems/dependency_resolver/index_specification.rb +0 -60
- data/lib/rubygems/dependency_resolver/installed_specification.rb +0 -52
- data/test/rubygems/test_gem_dependency_resolver_api_specification.rb +0 -33
- data/test/rubygems/test_gem_dependency_resolver_dependency_conflict.rb +0 -36
- data/test/rubygems/test_gem_dependency_resolver_index_set.rb +0 -53
- data/test/rubygems/test_gem_dependency_resolver_index_specification.rb +0 -73
- data/test/rubygems/test_gem_dependency_resolver_installed_specification.rb +0 -19
- data/test/rubygems/test_gem_dependency_resolver_installer_set.rb +0 -28
@@ -6,7 +6,7 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
6
6
|
def setup
|
7
7
|
super
|
8
8
|
|
9
|
-
|
9
|
+
spec_fetcher
|
10
10
|
|
11
11
|
@cmd = Gem::Commands::SourcesCommand.new
|
12
12
|
|
@@ -18,7 +18,6 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_execute
|
21
|
-
util_setup_spec_fetcher
|
22
21
|
@cmd.handle_options []
|
23
22
|
|
24
23
|
use_ui @ui do
|
@@ -36,9 +35,9 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
36
35
|
end
|
37
36
|
|
38
37
|
def test_execute_add
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
spec_fetcher do |fetcher|
|
39
|
+
fetcher.spec 'a', 1
|
40
|
+
end
|
42
41
|
|
43
42
|
specs = Gem::Specification.map { |spec|
|
44
43
|
[spec.name, spec.version, spec.original_platform]
|
@@ -54,8 +53,6 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
54
53
|
|
55
54
|
@cmd.handle_options %W[--add #{@new_repo}]
|
56
55
|
|
57
|
-
util_setup_spec_fetcher
|
58
|
-
|
59
56
|
use_ui @ui do
|
60
57
|
@cmd.execute
|
61
58
|
end
|
@@ -71,19 +68,13 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
|
|
71
68
|
end
|
72
69
|
|
73
70
|
def test_execute_add_nonexistent_source
|
74
|
-
util_setup_fake_fetcher
|
75
|
-
|
76
71
|
uri = "http://beta-gems.example.com/specs.#{@marshal_version}.gz"
|
77
72
|
@fetcher.data[uri] = proc do
|
78
73
|
raise Gem::RemoteFetcher::FetchError.new('it died', uri)
|
79
74
|
end
|
80
75
|
|
81
|
-
Gem::RemoteFetcher.fetcher = @fetcher
|
82
|
-
|
83
76
|
@cmd.handle_options %w[--add http://beta-gems.example.com]
|
84
77
|
|
85
|
-
util_setup_spec_fetcher
|
86
|
-
|
87
78
|
use_ui @ui do
|
88
79
|
assert_raises Gem::MockGemUi::TermError do
|
89
80
|
@cmd.execute
|
@@ -102,8 +93,6 @@ Error fetching http://beta-gems.example.com:
|
|
102
93
|
def test_execute_add_redundant_source
|
103
94
|
@cmd.handle_options %W[--add #{@gem_repo}]
|
104
95
|
|
105
|
-
util_setup_spec_fetcher
|
106
|
-
|
107
96
|
use_ui @ui do
|
108
97
|
@cmd.execute
|
109
98
|
end
|
@@ -120,9 +109,10 @@ source #{@gem_repo} already present in the cache
|
|
120
109
|
|
121
110
|
def test_execute_add_http_rubygems_org
|
122
111
|
http_rubygems_org = 'http://rubygems.org'
|
123
|
-
util_setup_fake_fetcher
|
124
112
|
|
125
|
-
|
113
|
+
spec_fetcher do |fetcher|
|
114
|
+
fetcher.spec 'a', 1
|
115
|
+
end
|
126
116
|
|
127
117
|
specs = Gem::Specification.map { |spec|
|
128
118
|
[spec.name, spec.version, spec.original_platform]
|
@@ -138,8 +128,6 @@ source #{@gem_repo} already present in the cache
|
|
138
128
|
|
139
129
|
@cmd.handle_options %W[--add #{http_rubygems_org}]
|
140
130
|
|
141
|
-
util_setup_spec_fetcher
|
142
|
-
|
143
131
|
ui = Gem::MockGemUi.new "n"
|
144
132
|
|
145
133
|
use_ui ui do
|
@@ -160,8 +148,6 @@ source #{@gem_repo} already present in the cache
|
|
160
148
|
def test_execute_add_bad_uri
|
161
149
|
@cmd.handle_options %w[--add beta-gems.example.com]
|
162
150
|
|
163
|
-
util_setup_spec_fetcher
|
164
|
-
|
165
151
|
use_ui @ui do
|
166
152
|
assert_raises Gem::MockGemUi::TermError do
|
167
153
|
@cmd.execute
|
@@ -181,8 +167,6 @@ beta-gems.example.com is not a URI
|
|
181
167
|
def test_execute_clear_all
|
182
168
|
@cmd.handle_options %w[--clear-all]
|
183
169
|
|
184
|
-
util_setup_spec_fetcher
|
185
|
-
|
186
170
|
use_ui @ui do
|
187
171
|
@cmd.execute
|
188
172
|
end
|
@@ -218,8 +202,6 @@ beta-gems.example.com is not a URI
|
|
218
202
|
def test_execute_remove
|
219
203
|
@cmd.handle_options %W[--remove #{@gem_repo}]
|
220
204
|
|
221
|
-
util_setup_spec_fetcher
|
222
|
-
|
223
205
|
use_ui @ui do
|
224
206
|
@cmd.execute
|
225
207
|
end
|
@@ -233,8 +215,6 @@ beta-gems.example.com is not a URI
|
|
233
215
|
def test_execute_remove_no_network
|
234
216
|
@cmd.handle_options %W[--remove #{@gem_repo}]
|
235
217
|
|
236
|
-
util_setup_fake_fetcher
|
237
|
-
|
238
218
|
@fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = proc do
|
239
219
|
raise Gem::RemoteFetcher::FetchError
|
240
220
|
end
|
@@ -252,22 +232,9 @@ beta-gems.example.com is not a URI
|
|
252
232
|
def test_execute_update
|
253
233
|
@cmd.handle_options %w[--update]
|
254
234
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
specs = Gem::Specification.map { |spec|
|
259
|
-
[spec.name, spec.version, spec.original_platform]
|
260
|
-
}
|
261
|
-
|
262
|
-
@fetcher.data["#{@gem_repo}specs.#{Gem.marshal_version}.gz"] =
|
263
|
-
util_gzip Marshal.dump(specs)
|
264
|
-
|
265
|
-
latest_specs = Gem::Specification.latest_specs.map { |spec|
|
266
|
-
[spec.name, spec.version, spec.original_platform]
|
267
|
-
}
|
268
|
-
|
269
|
-
@fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] =
|
270
|
-
util_gzip Marshal.dump(latest_specs)
|
235
|
+
spec_fetcher do |fetcher|
|
236
|
+
fetcher.gem 'a', 1
|
237
|
+
end
|
271
238
|
|
272
239
|
use_ui @ui do
|
273
240
|
@cmd.execute
|
@@ -10,7 +10,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_execute
|
13
|
-
foo =
|
13
|
+
foo = util_spec 'foo'
|
14
14
|
|
15
15
|
install_specs foo
|
16
16
|
|
@@ -26,8 +26,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_execute_all
|
29
|
-
|
30
|
-
|
29
|
+
util_spec 'foo', '0.0.1'
|
30
|
+
util_spec 'foo', '0.0.2'
|
31
31
|
|
32
32
|
@cmd.options[:args] = %w[foo]
|
33
33
|
@cmd.options[:all] = true
|
@@ -44,8 +44,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_execute_all_conflicts_with_version
|
47
|
-
|
48
|
-
|
47
|
+
util_spec 'foo', '0.0.1'
|
48
|
+
util_spec 'foo', '0.0.2'
|
49
49
|
|
50
50
|
@cmd.options[:args] = %w[foo]
|
51
51
|
@cmd.options[:all] = true
|
@@ -89,8 +89,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def test_execute_exact_match
|
92
|
-
|
93
|
-
|
92
|
+
util_spec 'foo'
|
93
|
+
util_spec 'foo_bar'
|
94
94
|
|
95
95
|
@cmd.options[:args] = %w[foo]
|
96
96
|
|
@@ -118,7 +118,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def test_execute_file
|
121
|
-
foo =
|
121
|
+
foo = util_spec 'foo' do |s|
|
122
122
|
s.files = %w[lib/code.rb]
|
123
123
|
end
|
124
124
|
|
@@ -152,14 +152,9 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def test_execute_remote
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
Gem::RemoteFetcher.fetcher = @fetcher
|
159
|
-
|
160
|
-
util_setup_spec_fetcher foo
|
161
|
-
|
162
|
-
FileUtils.rm File.join(@gemhome, 'specifications', foo.spec_name)
|
155
|
+
spec_fetcher do |fetcher|
|
156
|
+
fetcher.spec 'foo', 1
|
157
|
+
end
|
163
158
|
|
164
159
|
@cmd.options[:args] = %w[foo]
|
165
160
|
@cmd.options[:domain] = :remote
|
@@ -173,16 +168,10 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
173
168
|
end
|
174
169
|
|
175
170
|
def test_execute_remote_with_version
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
Gem::RemoteFetcher.fetcher = @fetcher
|
181
|
-
|
182
|
-
util_setup_spec_fetcher foo1, foo2
|
183
|
-
|
184
|
-
FileUtils.rm File.join(@gemhome, 'specifications', foo1.spec_name)
|
185
|
-
FileUtils.rm File.join(@gemhome, 'specifications', foo2.spec_name)
|
171
|
+
spec_fetcher do |fetcher|
|
172
|
+
fetcher.spec 'foo', "1"
|
173
|
+
fetcher.spec 'foo', "2"
|
174
|
+
end
|
186
175
|
|
187
176
|
@cmd.options[:args] = %w[foo]
|
188
177
|
@cmd.options[:version] = "1"
|
@@ -198,16 +187,10 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
198
187
|
end
|
199
188
|
|
200
189
|
def test_execute_remote_without_prerelease
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
@fetcher = Gem::FakeFetcher.new
|
207
|
-
Gem::RemoteFetcher.fetcher = @fetcher
|
208
|
-
|
209
|
-
util_setup_spec_fetcher foo
|
210
|
-
util_setup_spec_fetcher foo_pre
|
190
|
+
spec_fetcher do |fetcher|
|
191
|
+
fetcher.spec 'foo', '2.0.0'
|
192
|
+
fetcher.spec 'foo', '2.0.1.pre'
|
193
|
+
end
|
211
194
|
|
212
195
|
@cmd.options[:args] = %w[foo]
|
213
196
|
@cmd.options[:domain] = :remote
|
@@ -225,16 +208,10 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
225
208
|
end
|
226
209
|
|
227
210
|
def test_execute_remote_with_prerelease
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
@fetcher = Gem::FakeFetcher.new
|
234
|
-
Gem::RemoteFetcher.fetcher = @fetcher
|
235
|
-
|
236
|
-
util_setup_spec_fetcher foo
|
237
|
-
util_setup_spec_fetcher foo_pre
|
211
|
+
spec_fetcher do |fetcher|
|
212
|
+
fetcher.spec 'foo', '2.0.0'
|
213
|
+
fetcher.spec 'foo', '2.0.1.pre'
|
214
|
+
end
|
238
215
|
|
239
216
|
@cmd.options[:args] = %w[foo]
|
240
217
|
@cmd.options[:domain] = :remote
|
@@ -253,7 +230,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
|
|
253
230
|
end
|
254
231
|
|
255
232
|
def test_execute_ruby
|
256
|
-
foo =
|
233
|
+
foo = util_spec 'foo'
|
257
234
|
|
258
235
|
install_specs foo
|
259
236
|
|
@@ -10,11 +10,11 @@ class TestGemCommandsStaleCommand < Gem::TestCase
|
|
10
10
|
|
11
11
|
def test_execute_sorts
|
12
12
|
files = %w[lib/foo_bar.rb Rakefile]
|
13
|
-
foo_bar =
|
13
|
+
foo_bar = util_spec 'foo_bar' do |gem|
|
14
14
|
gem.files = files
|
15
15
|
end
|
16
16
|
|
17
|
-
bar_baz =
|
17
|
+
bar_baz = util_spec 'bar_baz' do |gem|
|
18
18
|
gem.files = files
|
19
19
|
end
|
20
20
|
|
@@ -24,7 +24,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
|
|
24
24
|
|
25
25
|
gemhome2 = "#{@gemhome}2"
|
26
26
|
|
27
|
-
a_4 =
|
27
|
+
a_4 = util_spec 'a', 4
|
28
28
|
install_gem a_4, :install_dir => gemhome2
|
29
29
|
|
30
30
|
Gem::Specification.dirs = [@gemhome, gemhome2]
|
@@ -126,7 +126,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def test_execute_prerelease
|
129
|
-
@spec =
|
129
|
+
@spec = util_spec "pre", "2.b"
|
130
130
|
@gem = File.join @tempdir, @spec.file_name
|
131
131
|
FileUtils.touch @gem
|
132
132
|
|
@@ -213,7 +213,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
|
|
213
213
|
|
214
214
|
gemhome2 = "#{@gemhome}2"
|
215
215
|
|
216
|
-
a_4 =
|
216
|
+
a_4 = util_spec 'a', 4
|
217
217
|
install_gem a_4, :install_dir => gemhome2
|
218
218
|
|
219
219
|
Gem::Specification.dirs = [@gemhome, gemhome2]
|
@@ -22,31 +22,22 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_get_path
|
25
|
-
|
26
|
-
|
27
|
-
util_setup_spec_fetcher @a1
|
28
|
-
|
29
|
-
a1_data = nil
|
30
|
-
|
31
|
-
open @a1.cache_file, 'rb' do |fp|
|
32
|
-
a1_data = fp.read
|
25
|
+
specs = spec_fetcher do |fetcher|
|
26
|
+
fetcher.gem 'a', 1
|
33
27
|
end
|
34
28
|
|
35
|
-
Gem::
|
36
|
-
a1_data
|
37
|
-
|
38
|
-
dep = Gem::Dependency.new(@a1.name, @a1.version)
|
29
|
+
dep = Gem::Dependency.new 'a', 1
|
39
30
|
assert_equal(
|
40
31
|
@cmd.get_path(dep),
|
41
|
-
|
32
|
+
specs['a-1'].cache_file,
|
42
33
|
'fetches a-1 and returns the cache path'
|
43
34
|
)
|
44
35
|
|
45
|
-
FileUtils.rm
|
36
|
+
FileUtils.rm specs['a-1'].cache_file
|
46
37
|
|
47
38
|
assert_equal(
|
48
39
|
@cmd.get_path(dep),
|
49
|
-
|
40
|
+
specs['a-1'].cache_file,
|
50
41
|
'when removed from cache, refetches a-1'
|
51
42
|
)
|
52
43
|
end
|
@@ -67,8 +58,9 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
67
58
|
end
|
68
59
|
|
69
60
|
def test_execute_gem_path
|
70
|
-
|
71
|
-
|
61
|
+
spec_fetcher do |fetcher|
|
62
|
+
fetcher.gem 'a', '3.a'
|
63
|
+
end
|
72
64
|
|
73
65
|
Gem.clear_paths
|
74
66
|
|
@@ -88,8 +80,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
88
80
|
end
|
89
81
|
|
90
82
|
def test_execute_gem_path_missing
|
91
|
-
|
92
|
-
util_setup_spec_fetcher
|
83
|
+
spec_fetcher
|
93
84
|
|
94
85
|
Gem.clear_paths
|
95
86
|
|
@@ -109,18 +100,13 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
109
100
|
end
|
110
101
|
|
111
102
|
def test_execute_remote
|
112
|
-
|
113
|
-
|
114
|
-
|
103
|
+
spec_fetcher do |fetcher|
|
104
|
+
fetcher.spec 'a', 1
|
105
|
+
fetcher.gem 'a', 2
|
115
106
|
|
116
|
-
|
117
|
-
open @a2.cache_file, 'rb' do |fp|
|
118
|
-
a2_data = fp.read
|
107
|
+
fetcher.clear
|
119
108
|
end
|
120
109
|
|
121
|
-
Gem::RemoteFetcher.fetcher.data['http://gems.example.com/gems/a-2.gem'] =
|
122
|
-
a2_data
|
123
|
-
|
124
110
|
Gem.configuration.verbose = :really
|
125
111
|
@cmd.options[:args] = %w[a]
|
126
112
|
|
@@ -186,8 +172,8 @@ class TestGemCommandsUnpackCommand < Gem::TestCase
|
|
186
172
|
end
|
187
173
|
|
188
174
|
def test_execute_exact_match
|
189
|
-
foo_spec =
|
190
|
-
foo_bar_spec =
|
175
|
+
foo_spec = util_spec 'foo'
|
176
|
+
foo_bar_spec = util_spec 'foo_bar'
|
191
177
|
|
192
178
|
use_ui @ui do
|
193
179
|
Dir.chdir @tempdir do
|
@@ -17,26 +17,27 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
17
17
|
|
18
18
|
@cmd.options[:document] = []
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
@
|
29
|
-
|
30
|
-
@
|
31
|
-
read_binary @a2_path
|
32
|
-
@fetcher.data["#{@gem_repo}gems/#{File.basename @a3a_path}"] =
|
33
|
-
read_binary @a3a_path
|
20
|
+
@specs = spec_fetcher do |fetcher|
|
21
|
+
fetcher.gem 'a', 1
|
22
|
+
fetcher.gem 'a', 2
|
23
|
+
fetcher.gem 'a', '3.a'
|
24
|
+
|
25
|
+
fetcher.clear
|
26
|
+
end
|
27
|
+
|
28
|
+
@a1_path = @specs['a-1'].cache_file
|
29
|
+
@a2_path = @specs['a-1'].cache_file
|
30
|
+
@a3a_path = @specs['a-3.a'].cache_file
|
34
31
|
end
|
35
32
|
|
36
33
|
def test_execute
|
37
|
-
|
34
|
+
spec_fetcher do |fetcher|
|
35
|
+
fetcher.gem 'a', 2
|
38
36
|
|
39
|
-
|
37
|
+
fetcher.clear
|
38
|
+
|
39
|
+
fetcher.spec 'a', 1
|
40
|
+
end
|
40
41
|
|
41
42
|
@cmd.options[:args] = []
|
42
43
|
|
@@ -46,48 +47,17 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
46
47
|
|
47
48
|
out = @ui.output.split "\n"
|
48
49
|
assert_equal "Updating installed gems", out.shift
|
49
|
-
assert_equal "Updating
|
50
|
-
assert_equal "Gems updated:
|
50
|
+
assert_equal "Updating a", out.shift
|
51
|
+
assert_equal "Gems updated: a", out.shift
|
51
52
|
assert_empty out
|
52
53
|
end
|
53
54
|
|
54
|
-
def
|
55
|
-
|
56
|
-
s.files = %w[setup.rb]
|
57
|
-
end
|
58
|
-
write_file File.join(*%W[gems #{gem.original_name} setup.rb])
|
59
|
-
util_build_gem gem
|
60
|
-
util_setup_spec_fetcher gem
|
61
|
-
gem
|
62
|
-
end
|
63
|
-
|
64
|
-
def util_setup_rubygem8
|
65
|
-
@rubygem8 = util_setup_rubygem 8
|
66
|
-
end
|
67
|
-
|
68
|
-
def util_setup_rubygem9
|
69
|
-
@rubygem9 = util_setup_rubygem 9
|
70
|
-
end
|
71
|
-
|
72
|
-
def util_setup_rubygem_current
|
73
|
-
@rubygem_current = util_setup_rubygem Gem::VERSION
|
74
|
-
end
|
75
|
-
|
76
|
-
def util_add_to_fetcher *specs
|
77
|
-
specs.each do |spec|
|
78
|
-
gem_file = spec.cache_file
|
79
|
-
file_name = File.basename gem_file
|
55
|
+
def test_execute_system
|
56
|
+
spec_fetcher do |fetcher|
|
57
|
+
fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
|
80
58
|
|
81
|
-
|
82
|
-
Gem.read_binary gem_file
|
59
|
+
fetcher.clear
|
83
60
|
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def test_execute_system
|
87
|
-
util_clear_gems
|
88
|
-
util_setup_rubygem9
|
89
|
-
util_setup_spec_fetcher @rubygem9
|
90
|
-
util_add_to_fetcher @rubygem9
|
91
61
|
|
92
62
|
@cmd.options[:args] = []
|
93
63
|
@cmd.options[:system] = true
|
@@ -105,10 +75,13 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
105
75
|
end
|
106
76
|
|
107
77
|
def test_execute_system_at_latest
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
78
|
+
spec_fetcher do |fetcher|
|
79
|
+
fetcher.gem 'rubygems-update', Gem::VERSION do |s|
|
80
|
+
s.files = %w[setup.rb]
|
81
|
+
end
|
82
|
+
|
83
|
+
fetcher.clear
|
84
|
+
end
|
112
85
|
|
113
86
|
@cmd.options[:args] = []
|
114
87
|
@cmd.options[:system] = true
|
@@ -125,11 +98,12 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
125
98
|
end
|
126
99
|
|
127
100
|
def test_execute_system_multiple
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
101
|
+
spec_fetcher do |fetcher|
|
102
|
+
fetcher.gem 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
|
103
|
+
fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
|
104
|
+
|
105
|
+
fetcher.clear
|
106
|
+
end
|
133
107
|
|
134
108
|
@cmd.options[:args] = []
|
135
109
|
@cmd.options[:system] = true
|
@@ -147,11 +121,12 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
147
121
|
end
|
148
122
|
|
149
123
|
def test_execute_system_specific
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
124
|
+
spec_fetcher do |fetcher|
|
125
|
+
fetcher.gem 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
|
126
|
+
fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
|
127
|
+
|
128
|
+
fetcher.clear
|
129
|
+
end
|
155
130
|
|
156
131
|
@cmd.options[:args] = []
|
157
132
|
@cmd.options[:system] = "8"
|
@@ -169,11 +144,12 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
169
144
|
end
|
170
145
|
|
171
146
|
def test_execute_system_specifically_to_latest_version
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
147
|
+
spec_fetcher do |fetcher|
|
148
|
+
fetcher.gem 'rubygems-update', 8 do |s| s.files = %w[setup.rb] end
|
149
|
+
fetcher.gem 'rubygems-update', 9 do |s| s.files = %w[setup.rb] end
|
150
|
+
|
151
|
+
fetcher.clear
|
152
|
+
end
|
177
153
|
|
178
154
|
@cmd.options[:args] = []
|
179
155
|
@cmd.options[:system] = "9"
|
@@ -212,36 +188,16 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
212
188
|
# a2 -> c2
|
213
189
|
|
214
190
|
def test_execute_dependencies
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
s.require_paths = %w[lib]
|
220
|
-
end
|
221
|
-
|
222
|
-
@a2.add_dependency 'c', '2'
|
223
|
-
@a2.add_dependency 'b', '2'
|
224
|
-
|
225
|
-
@b2_path = @b2.cache_file
|
226
|
-
@c1_2_path = @c1_2.cache_file
|
227
|
-
@c2_path = @c2.cache_file
|
228
|
-
|
229
|
-
install_specs @a1, @a2, @b2, @c1_2, @c2
|
230
|
-
|
231
|
-
util_build_gem @a1
|
232
|
-
util_build_gem @a2
|
233
|
-
util_build_gem @c2
|
191
|
+
spec_fetcher do |fetcher|
|
192
|
+
fetcher.gem 'a', 2, 'b' => 2, 'c' => 2
|
193
|
+
fetcher.gem 'b', 2
|
194
|
+
fetcher.gem 'c', 2
|
234
195
|
|
235
|
-
|
236
|
-
@fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] = read_binary @a2_path
|
237
|
-
@fetcher.data["#{@gem_repo}gems/#{@b2.file_name}"] = read_binary @b2_path
|
238
|
-
@fetcher.data["#{@gem_repo}gems/#{@c1_2.file_name}"] = read_binary @c1_2_path
|
239
|
-
@fetcher.data["#{@gem_repo}gems/#{@c2.file_name}"] = read_binary @c2_path
|
196
|
+
fetcher.clear
|
240
197
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
Gem::Installer.new(@a1_path).install
|
198
|
+
fetcher.spec 'a', 1, 'c' => '1.2'
|
199
|
+
fetcher.spec 'c', '1.2'
|
200
|
+
end
|
245
201
|
|
246
202
|
Gem::Specification.reset
|
247
203
|
|
@@ -253,23 +209,27 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
253
209
|
|
254
210
|
out = @ui.output.split "\n"
|
255
211
|
assert_equal "Updating installed gems", out.shift
|
256
|
-
assert_equal "Updating
|
257
|
-
assert_equal "Gems updated:
|
212
|
+
assert_equal "Updating a", out.shift
|
213
|
+
assert_equal "Gems updated: a b c",
|
258
214
|
out.shift
|
259
215
|
|
260
216
|
assert_empty out
|
261
217
|
end
|
262
218
|
|
263
219
|
def test_execute_rdoc
|
264
|
-
|
220
|
+
spec_fetcher do |fetcher|
|
221
|
+
fetcher.gem 'a', 2
|
265
222
|
|
266
|
-
|
223
|
+
fetcher.clear
|
267
224
|
|
268
|
-
|
225
|
+
fetcher.spec 'a', 1
|
226
|
+
end
|
269
227
|
|
270
|
-
Gem::
|
228
|
+
Gem.done_installing(&Gem::RDoc.method(:generation_hook))
|
229
|
+
|
230
|
+
@cmd.options[:document] = %w[rdoc ri]
|
271
231
|
|
272
|
-
@cmd.options[:args] = [
|
232
|
+
@cmd.options[:args] = %w[a]
|
273
233
|
|
274
234
|
use_ui @ui do
|
275
235
|
@cmd.execute
|
@@ -277,16 +237,22 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
277
237
|
|
278
238
|
wait_for_child_process_to_exit
|
279
239
|
|
280
|
-
|
281
|
-
|
240
|
+
a2 = @specs['a-2']
|
241
|
+
|
242
|
+
assert_path_exists File.join(a2.doc_dir, 'ri')
|
243
|
+
assert_path_exists File.join(a2.doc_dir, 'rdoc')
|
282
244
|
end
|
283
245
|
|
284
246
|
def test_execute_named
|
285
|
-
|
247
|
+
spec_fetcher do |fetcher|
|
248
|
+
fetcher.gem 'a', 2
|
286
249
|
|
287
|
-
|
250
|
+
fetcher.clear
|
288
251
|
|
289
|
-
|
252
|
+
fetcher.spec 'a', 1
|
253
|
+
end
|
254
|
+
|
255
|
+
@cmd.options[:args] = %w[a]
|
290
256
|
|
291
257
|
use_ui @ui do
|
292
258
|
@cmd.execute
|
@@ -294,18 +260,18 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
294
260
|
|
295
261
|
out = @ui.output.split "\n"
|
296
262
|
assert_equal "Updating installed gems", out.shift
|
297
|
-
assert_equal "Updating
|
298
|
-
assert_equal "Gems updated:
|
263
|
+
assert_equal "Updating a", out.shift
|
264
|
+
assert_equal "Gems updated: a", out.shift
|
299
265
|
|
300
266
|
assert_empty out
|
301
267
|
end
|
302
268
|
|
303
269
|
def test_execute_named_up_to_date
|
304
|
-
|
305
|
-
|
306
|
-
|
270
|
+
spec_fetcher do |fetcher|
|
271
|
+
fetcher.spec 'a', 2
|
272
|
+
end
|
307
273
|
|
308
|
-
@cmd.options[:args] = [
|
274
|
+
@cmd.options[:args] = %w[a]
|
309
275
|
|
310
276
|
use_ui @ui do
|
311
277
|
@cmd.execute
|
@@ -319,11 +285,15 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
319
285
|
end
|
320
286
|
|
321
287
|
def test_execute_named_up_to_date_prerelease
|
322
|
-
|
288
|
+
spec_fetcher do |fetcher|
|
289
|
+
fetcher.gem 'a', '3.a'
|
323
290
|
|
324
|
-
|
291
|
+
fetcher.clear
|
325
292
|
|
326
|
-
|
293
|
+
fetcher.gem 'a', 2
|
294
|
+
end
|
295
|
+
|
296
|
+
@cmd.options[:args] = %w[a]
|
327
297
|
@cmd.options[:prerelease] = true
|
328
298
|
|
329
299
|
use_ui @ui do
|
@@ -332,16 +302,16 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
332
302
|
|
333
303
|
out = @ui.output.split "\n"
|
334
304
|
assert_equal "Updating installed gems", out.shift
|
335
|
-
assert_equal "Updating
|
336
|
-
assert_equal "Gems updated:
|
305
|
+
assert_equal "Updating a", out.shift
|
306
|
+
assert_equal "Gems updated: a", out.shift
|
337
307
|
|
338
308
|
assert_empty out
|
339
309
|
end
|
340
310
|
|
341
311
|
def test_execute_up_to_date
|
342
|
-
|
343
|
-
|
344
|
-
|
312
|
+
spec_fetcher do |fetcher|
|
313
|
+
fetcher.gem 'a', 2
|
314
|
+
end
|
345
315
|
|
346
316
|
@cmd.options[:args] = []
|
347
317
|
|
@@ -357,9 +327,13 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
357
327
|
end
|
358
328
|
|
359
329
|
def test_execute_user_install
|
360
|
-
|
330
|
+
spec_fetcher do |fetcher|
|
331
|
+
fetcher.gem 'a', 2
|
361
332
|
|
362
|
-
|
333
|
+
fetcher.clear
|
334
|
+
|
335
|
+
fetcher.spec 'a', 1
|
336
|
+
end
|
363
337
|
|
364
338
|
@cmd.handle_options %w[--user-install]
|
365
339
|
|
@@ -374,37 +348,51 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
374
348
|
end
|
375
349
|
|
376
350
|
def test_fetch_remote_gems
|
351
|
+
specs = spec_fetcher do |fetcher|
|
352
|
+
fetcher.gem 'a', 1
|
353
|
+
fetcher.gem 'a', 2
|
354
|
+
end
|
355
|
+
|
377
356
|
expected = [
|
378
357
|
[Gem::NameTuple.new('a', v(2), Gem::Platform::RUBY),
|
379
358
|
Gem::Source.new(@gem_repo)],
|
380
359
|
]
|
381
360
|
|
382
|
-
assert_equal expected, @cmd.fetch_remote_gems(
|
361
|
+
assert_equal expected, @cmd.fetch_remote_gems(specs['a-1'])
|
383
362
|
end
|
384
363
|
|
385
364
|
def test_fetch_remote_gems_error
|
386
365
|
Gem.sources.replace %w[http://nonexistent.example]
|
387
366
|
|
388
367
|
assert_raises Gem::RemoteFetcher::FetchError do
|
389
|
-
@cmd.fetch_remote_gems @
|
368
|
+
@cmd.fetch_remote_gems @specs['a-1']
|
390
369
|
end
|
391
370
|
end
|
392
371
|
|
393
372
|
def test_fetch_remote_gems_mismatch
|
394
373
|
platform = Gem::Platform.new 'x86-freebsd9'
|
395
|
-
a2_p = quick_spec 'a', 2 do |s| s.platform = platform end
|
396
374
|
|
397
|
-
|
375
|
+
specs = spec_fetcher do |fetcher|
|
376
|
+
fetcher.spec 'a', 1
|
377
|
+
fetcher.spec 'a', 2
|
378
|
+
fetcher.spec 'a', 2 do |s| s.platform = platform end
|
379
|
+
end
|
398
380
|
|
399
381
|
expected = [
|
400
382
|
[Gem::NameTuple.new('a', v(2), Gem::Platform::RUBY),
|
401
383
|
Gem::Source.new(@gem_repo)],
|
402
384
|
]
|
403
385
|
|
404
|
-
assert_equal expected, @cmd.fetch_remote_gems(
|
386
|
+
assert_equal expected, @cmd.fetch_remote_gems(specs['a-1'])
|
405
387
|
end
|
406
388
|
|
407
389
|
def test_fetch_remote_gems_prerelease
|
390
|
+
specs = spec_fetcher do |fetcher|
|
391
|
+
fetcher.gem 'a', 1
|
392
|
+
fetcher.gem 'a', 2
|
393
|
+
fetcher.gem 'a', '3.a'
|
394
|
+
end
|
395
|
+
|
408
396
|
@cmd.options[:prerelease] = true
|
409
397
|
|
410
398
|
expected = [
|
@@ -414,7 +402,7 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
414
402
|
Gem::Source.new(@gem_repo)],
|
415
403
|
]
|
416
404
|
|
417
|
-
assert_equal expected, @cmd.fetch_remote_gems(
|
405
|
+
assert_equal expected, @cmd.fetch_remote_gems(specs['a-1'])
|
418
406
|
end
|
419
407
|
|
420
408
|
def test_handle_options_system
|
@@ -449,4 +437,31 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
449
437
|
assert_equal expected, @cmd.options
|
450
438
|
end
|
451
439
|
|
440
|
+
def test_update_rubygems_arguments
|
441
|
+
@cmd.options[:system] = true
|
442
|
+
|
443
|
+
arguments = @cmd.update_rubygems_arguments
|
444
|
+
|
445
|
+
assert_equal '--prefix', arguments.shift
|
446
|
+
assert_equal Gem.prefix, arguments.shift
|
447
|
+
assert_equal '--no-rdoc', arguments.shift
|
448
|
+
assert_equal '--no-ri', arguments.shift
|
449
|
+
assert_equal '--previous-version', arguments.shift
|
450
|
+
assert_equal Gem::VERSION, arguments.shift
|
451
|
+
assert_empty arguments
|
452
|
+
end
|
453
|
+
|
454
|
+
def test_update_rubygems_arguments_1_8_x
|
455
|
+
@cmd.options[:system] = '1.8.26'
|
456
|
+
|
457
|
+
arguments = @cmd.update_rubygems_arguments
|
458
|
+
|
459
|
+
assert_equal '--prefix', arguments.shift
|
460
|
+
assert_equal Gem.prefix, arguments.shift
|
461
|
+
assert_equal '--no-rdoc', arguments.shift
|
462
|
+
assert_equal '--no-ri', arguments.shift
|
463
|
+
assert_empty arguments
|
464
|
+
end
|
465
|
+
|
452
466
|
end
|
467
|
+
|