rubygems-update 0.9.5 → 1.0.0
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.
- data/ChangeLog +135 -0
- data/Rakefile +3 -1
- data/lib/rubygems.rb +27 -38
- data/lib/rubygems/commands/install_command.rb +2 -0
- data/lib/rubygems/commands/mirror_command.rb +8 -2
- data/lib/rubygems/commands/query_command.rb +3 -1
- data/lib/rubygems/commands/server_command.rb +3 -3
- data/lib/rubygems/commands/unpack_command.rb +11 -4
- data/lib/rubygems/commands/update_command.rb +114 -108
- data/lib/rubygems/defaults.rb +46 -0
- data/lib/rubygems/dependency_installer.rb +13 -2
- data/lib/rubygems/indexer.rb +1 -1
- data/lib/rubygems/install_update_options.rb +7 -0
- data/lib/rubygems/installer.rb +66 -11
- data/lib/rubygems/package.rb +2 -1
- data/lib/rubygems/platform.rb +24 -30
- data/lib/rubygems/remote_fetcher.rb +7 -3
- data/lib/rubygems/require_paths_builder.rb +15 -0
- data/lib/rubygems/rubygems_version.rb +1 -1
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/server.rb +18 -3
- data/lib/rubygems/source_index.rb +20 -23
- data/lib/rubygems/source_info_cache.rb +3 -3
- data/lib/rubygems/specification.rb +64 -31
- data/lib/rubygems/uninstaller.rb +1 -1
- data/lib/rubygems/validator.rb +3 -2
- data/lib/rubygems/version.rb +10 -3
- data/setup.rb +30 -6
- data/test/gemutilities.rb +23 -13
- data/test/gemutilities.rbc +0 -0
- data/test/mockgemui.rbc +0 -0
- data/test/test_gem.rb +46 -76
- data/test/test_gem.rbc +0 -0
- data/test/test_gem_commands_build_command.rb +12 -12
- data/test/test_gem_commands_dependency_command.rb +10 -10
- data/test/test_gem_commands_mirror_command.rb +9 -4
- data/test/test_gem_commands_query_command.rb +7 -3
- data/test/test_gem_commands_server_command.rb +27 -0
- data/test/test_gem_commands_unpack_command.rb +20 -2
- data/test/test_gem_format.rb +1 -1
- data/test/test_gem_indexer.rb +5 -5
- data/test/test_gem_install_update_options.rb +1 -1
- data/test/test_gem_installer.rb +149 -60
- data/test/test_gem_platform.rb +19 -0
- data/test/test_gem_remote_fetcher.rb +19 -2
- data/test/test_gem_server.rb +44 -1
- data/test/test_gem_source_index.rb +2 -2
- data/test/test_gem_specification.rb +300 -168
- data/test/test_gem_version.rb +15 -0
- data/test/test_kernel.rb +19 -19
- metadata +46 -42
- data/lib/rubygems/remote_installer.rb +0 -195
- data/test/test_gem_remote_installer.rb +0 -161
data/test/gemutilities.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
at_exit { $SAFE = 1 }
|
9
9
|
|
10
10
|
require 'fileutils'
|
11
|
-
require 'test/unit
|
11
|
+
require 'test/unit'
|
12
12
|
require 'tmpdir'
|
13
13
|
require 'uri'
|
14
14
|
require 'rubygems/gem_open_uri'
|
@@ -20,6 +20,10 @@ module Gem
|
|
20
20
|
def self.source_index=(si)
|
21
21
|
@@source_index = si
|
22
22
|
end
|
23
|
+
|
24
|
+
def self.win_platform=(val)
|
25
|
+
@@win_platform = val
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
class FakeFetcher
|
@@ -58,7 +62,8 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
58
62
|
|
59
63
|
include Gem::DefaultUserInteraction
|
60
64
|
|
61
|
-
undef_method :default_test
|
65
|
+
undef_method :default_test if instance_methods.include? 'default_test' or
|
66
|
+
instance_methods.include? :default_test
|
62
67
|
|
63
68
|
def setup
|
64
69
|
super
|
@@ -84,7 +89,10 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
84
89
|
@gem_repo = "http://gems.example.com"
|
85
90
|
Gem.sources.replace [@gem_repo]
|
86
91
|
|
87
|
-
@
|
92
|
+
@orig_BASERUBY = Gem::ConfigMap[:BASERUBY]
|
93
|
+
Gem::ConfigMap[:BASERUBY] = Gem::ConfigMap[:RUBY_INSTALL_NAME]
|
94
|
+
|
95
|
+
@orig_arch = Gem::ConfigMap[:arch]
|
88
96
|
|
89
97
|
if win_platform?
|
90
98
|
util_set_arch 'i386-mswin32'
|
@@ -96,7 +104,8 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
96
104
|
end
|
97
105
|
|
98
106
|
def teardown
|
99
|
-
|
107
|
+
Gem::ConfigMap[:BASERUBY] = @orig_BASERUBY
|
108
|
+
Gem::ConfigMap[:arch] = @orig_arch
|
100
109
|
|
101
110
|
if defined? Gem::RemoteFetcher then
|
102
111
|
Gem::RemoteFetcher.instance_variable_set :@fetcher, nil
|
@@ -148,7 +157,7 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
148
157
|
path
|
149
158
|
end
|
150
159
|
|
151
|
-
def quick_gem(gemname, version='
|
160
|
+
def quick_gem(gemname, version='2')
|
152
161
|
require 'rubygems/specification'
|
153
162
|
|
154
163
|
spec = Gem::Specification.new do |s|
|
@@ -161,6 +170,7 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
161
170
|
s.has_rdoc = true
|
162
171
|
s.summary = "this is a summary"
|
163
172
|
s.description = "This is a test description"
|
173
|
+
|
164
174
|
yield(s) if block_given?
|
165
175
|
end
|
166
176
|
|
@@ -200,9 +210,9 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
200
210
|
s.require_paths = %w[lib]
|
201
211
|
end
|
202
212
|
|
203
|
-
@
|
204
|
-
@
|
205
|
-
@
|
213
|
+
@a1 = quick_gem('a', '1', &spec)
|
214
|
+
@a2 = quick_gem('a', '2', &spec)
|
215
|
+
@b2 = quick_gem('b', '2', &spec)
|
206
216
|
@c1_2 = quick_gem('c', '1.2', &spec)
|
207
217
|
@pl1 = quick_gem 'pl', '1' do |s| # l for legacy
|
208
218
|
s.files = %w[lib/code.rb]
|
@@ -211,13 +221,13 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
211
221
|
s.instance_variable_set :@original_platform, 'i386-linux'
|
212
222
|
end
|
213
223
|
|
214
|
-
write_file File.join(*%W[gems #{@
|
215
|
-
write_file File.join(*%W[gems #{@
|
216
|
-
write_file File.join(*%W[gems #{@
|
224
|
+
write_file File.join(*%W[gems #{@a1.original_name} lib code.rb]) do end
|
225
|
+
write_file File.join(*%W[gems #{@a2.original_name} lib code.rb]) do end
|
226
|
+
write_file File.join(*%W[gems #{@b2.original_name} lib code.rb]) do end
|
217
227
|
write_file File.join(*%W[gems #{@c1_2.original_name} lib code.rb]) do end
|
218
228
|
write_file File.join(*%W[gems #{@pl1.original_name} lib code.rb]) do end
|
219
229
|
|
220
|
-
[@
|
230
|
+
[@a1, @a2, @b2, @c1_2, @pl1].each { |spec| util_build_gem spec }
|
221
231
|
|
222
232
|
FileUtils.rm_r File.join(@gemhome, 'gems', @pl1.original_name)
|
223
233
|
|
@@ -228,7 +238,7 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
228
238
|
# Set the platform to +cpu+ and +os+
|
229
239
|
|
230
240
|
def util_set_arch(arch)
|
231
|
-
|
241
|
+
Gem::ConfigMap[:arch] = arch
|
232
242
|
platform = Gem::Platform.new arch
|
233
243
|
|
234
244
|
Gem.instance_variable_set :@platforms, nil
|
Binary file
|
data/test/mockgemui.rbc
ADDED
Binary file
|
data/test/test_gem.rb
CHANGED
@@ -2,6 +2,7 @@ require 'test/unit'
|
|
2
2
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rubygems/gem_openssl'
|
5
|
+
require 'rubygems/installer'
|
5
6
|
require 'pathname'
|
6
7
|
|
7
8
|
class TestGem < RubyGemTestCase
|
@@ -17,9 +18,9 @@ class TestGem < RubyGemTestCase
|
|
17
18
|
util_make_gems
|
18
19
|
|
19
20
|
expected = [
|
20
|
-
File.join(@gemhome, *%W[gems #{@
|
21
|
-
File.join(@gemhome, *%W[gems #{@
|
22
|
-
File.join(@gemhome, *%W[gems #{@
|
21
|
+
File.join(@gemhome, *%W[gems #{@a1.full_name} lib]),
|
22
|
+
File.join(@gemhome, *%W[gems #{@a2.full_name} lib]),
|
23
|
+
File.join(@gemhome, *%W[gems #{@b2.full_name} lib]),
|
23
24
|
File.join(@gemhome, *%W[gems #{@c1_2.full_name} lib]),
|
24
25
|
File.join(@gemhome, *%W[gems #{@pl1.full_name} lib]),
|
25
26
|
]
|
@@ -89,6 +90,42 @@ class TestGem < RubyGemTestCase
|
|
89
90
|
assert_match @default_dir_re, Gem.default_dir
|
90
91
|
end
|
91
92
|
|
93
|
+
def test_self_default_exec_format
|
94
|
+
orig_BASERUBY = Gem::ConfigMap[:BASERUBY]
|
95
|
+
orig_RUBY_INSTALL_NAME = Gem::ConfigMap[:RUBY_INSTALL_NAME]
|
96
|
+
Gem::ConfigMap[:BASERUBY] = 'ruby'
|
97
|
+
Gem::ConfigMap[:RUBY_INSTALL_NAME] = 'ruby'
|
98
|
+
|
99
|
+
assert_equal '%s', Gem.default_exec_format
|
100
|
+
ensure
|
101
|
+
Gem::ConfigMap[:BASERUBY] = orig_BASERUBY
|
102
|
+
Gem::ConfigMap[:RUBY_INSTALL_NAME] = orig_RUBY_INSTALL_NAME
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_self_default_exec_format_18
|
106
|
+
orig_BASERUBY = Gem::ConfigMap[:BASERUBY]
|
107
|
+
orig_RUBY_INSTALL_NAME = Gem::ConfigMap[:RUBY_INSTALL_NAME]
|
108
|
+
Gem::ConfigMap[:BASERUBY] = 'ruby'
|
109
|
+
Gem::ConfigMap[:RUBY_INSTALL_NAME] = 'ruby18'
|
110
|
+
|
111
|
+
assert_equal '%s18', Gem.default_exec_format
|
112
|
+
ensure
|
113
|
+
Gem::ConfigMap[:BASERUBY] = orig_BASERUBY
|
114
|
+
Gem::ConfigMap[:RUBY_INSTALL_NAME] = orig_RUBY_INSTALL_NAME
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_self_default_exec_format_jruby
|
118
|
+
orig_BASERUBY = Gem::ConfigMap[:BASERUBY]
|
119
|
+
orig_RUBY_INSTALL_NAME = Gem::ConfigMap[:RUBY_INSTALL_NAME]
|
120
|
+
Gem::ConfigMap[:BASERUBY] = 'ruby'
|
121
|
+
Gem::ConfigMap[:RUBY_INSTALL_NAME] = 'jruby'
|
122
|
+
|
123
|
+
assert_equal 'j%s', Gem.default_exec_format
|
124
|
+
ensure
|
125
|
+
Gem::ConfigMap[:BASERUBY] = orig_BASERUBY
|
126
|
+
Gem::ConfigMap[:RUBY_INSTALL_NAME] = orig_RUBY_INSTALL_NAME
|
127
|
+
end
|
128
|
+
|
92
129
|
def test_self_default_sources
|
93
130
|
assert_equal %w[http://gems.rubyforge.org], Gem.default_sources
|
94
131
|
end
|
@@ -174,8 +211,8 @@ class TestGem < RubyGemTestCase
|
|
174
211
|
util_make_gems
|
175
212
|
|
176
213
|
expected = [
|
177
|
-
File.join(@gemhome, *%W[gems #{@
|
178
|
-
File.join(@gemhome, *%W[gems #{@
|
214
|
+
File.join(@gemhome, *%W[gems #{@a2.full_name} lib]),
|
215
|
+
File.join(@gemhome, *%W[gems #{@b2.full_name} lib]),
|
179
216
|
File.join(@gemhome, *%W[gems #{@c1_2.full_name} lib]),
|
180
217
|
File.join(@gemhome, *%W[gems #{@pl1.full_name} lib]),
|
181
218
|
]
|
@@ -251,10 +288,10 @@ class TestGem < RubyGemTestCase
|
|
251
288
|
|
252
289
|
assert_equal File.join(@tempdir, *%w[gemhome gems c-1.2 lib code.rb]),
|
253
290
|
Gem.required_location("c", "code.rb")
|
254
|
-
assert_equal File.join(@tempdir, *%w[gemhome gems a-
|
255
|
-
Gem.required_location("a", "code.rb", "<
|
256
|
-
assert_equal File.join(@tempdir, *%w[gemhome gems a-
|
257
|
-
Gem.required_location("a", "code.rb", "=
|
291
|
+
assert_equal File.join(@tempdir, *%w[gemhome gems a-1 lib code.rb]),
|
292
|
+
Gem.required_location("a", "code.rb", "< 2")
|
293
|
+
assert_equal File.join(@tempdir, *%w[gemhome gems a-2 lib code.rb]),
|
294
|
+
Gem.required_location("a", "code.rb", "= 2")
|
258
295
|
end
|
259
296
|
|
260
297
|
def test_self_searcher
|
@@ -298,73 +335,6 @@ class TestGem < RubyGemTestCase
|
|
298
335
|
end
|
299
336
|
end
|
300
337
|
|
301
|
-
def test_require_gem_autorequire
|
302
|
-
name = "AutorequireArray"
|
303
|
-
files = %w(a.rb b.rb)
|
304
|
-
gem = quick_gem(name) do |s|
|
305
|
-
s.files = files.map { |f| File.join("lib", f) }
|
306
|
-
s.autorequire = files
|
307
|
-
end
|
308
|
-
|
309
|
-
fullname = gem.full_name
|
310
|
-
|
311
|
-
write_file "gems/#{fullname}/lib/a.rb" do |io|
|
312
|
-
io.puts "$LOADED_A = true"
|
313
|
-
end
|
314
|
-
|
315
|
-
write_file "gems/#{fullname}/lib/b.rb" do |io|
|
316
|
-
io.puts "$LOADED_B = true"
|
317
|
-
end
|
318
|
-
|
319
|
-
Gem.source_index = nil
|
320
|
-
|
321
|
-
old_loaded = $".dup
|
322
|
-
old_verbose = $VERBOSE
|
323
|
-
$VERBOSE = nil
|
324
|
-
require_gem name
|
325
|
-
$VERBOSE = old_verbose
|
326
|
-
new_loaded = $".dup
|
327
|
-
|
328
|
-
if RUBY_VERSION > "1.9" then
|
329
|
-
files = files.map do |file|
|
330
|
-
File.join @gemhome, 'gems', gem.full_name, 'lib', file
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
assert_equal files, (new_loaded - old_loaded)
|
335
|
-
assert defined?($LOADED_A)
|
336
|
-
assert defined?($LOADED_B)
|
337
|
-
end
|
338
|
-
|
339
|
-
def test_require_gem_autorequire_string
|
340
|
-
name = "AutorequireString"
|
341
|
-
file = "c.rb"
|
342
|
-
gem = quick_gem(name) do |s|
|
343
|
-
s.files = File.join("lib", file)
|
344
|
-
s.autorequire = file
|
345
|
-
end
|
346
|
-
|
347
|
-
fullname = gem.full_name
|
348
|
-
|
349
|
-
write_file("gems/#{fullname}/lib/c.rb") do |io|
|
350
|
-
io.puts "$LOADED_C = true"
|
351
|
-
end
|
352
|
-
|
353
|
-
old_loaded = $".dup
|
354
|
-
old_verbose = $VERBOSE
|
355
|
-
$VERBOSE = nil
|
356
|
-
require_gem name
|
357
|
-
$VERBOSE = old_verbose
|
358
|
-
new_loaded = $".dup
|
359
|
-
|
360
|
-
if RUBY_VERSION > "1.9" then
|
361
|
-
file = File.join @gemhome, 'gems', gem.full_name, 'lib', file
|
362
|
-
end
|
363
|
-
|
364
|
-
assert_equal(Array(file), (new_loaded - old_loaded))
|
365
|
-
assert(defined? $LOADED_C)
|
366
|
-
end
|
367
|
-
|
368
338
|
def util_ensure_gem_dirs
|
369
339
|
Gem.ensure_gem_subdirectories @gemhome
|
370
340
|
@additional.each do |dir|
|
data/test/test_gem.rbc
ADDED
Binary file
|
@@ -8,31 +8,31 @@ class TestGemCommandsBuildCommand < RubyGemTestCase
|
|
8
8
|
def setup
|
9
9
|
super
|
10
10
|
|
11
|
+
@gem = quick_gem 'some_gem' do |s|
|
12
|
+
s.rubyforge_project = 'example'
|
13
|
+
end
|
14
|
+
|
11
15
|
@cmd = Gem::Commands::BuildCommand.new
|
12
16
|
end
|
13
17
|
|
14
18
|
def test_execute
|
15
|
-
|
16
|
-
|
17
|
-
gemspec_file = File.join(@tempdir, "#{gem.full_name}.gemspec")
|
19
|
+
gemspec_file = File.join(@tempdir, "#{@gem.full_name}.gemspec")
|
18
20
|
|
19
21
|
File.open gemspec_file, 'w' do |gs|
|
20
|
-
gs.write gem.to_ruby
|
22
|
+
gs.write @gem.to_ruby
|
21
23
|
end
|
22
24
|
|
23
|
-
util_test_build_gem gem, gemspec_file
|
25
|
+
util_test_build_gem @gem, gemspec_file
|
24
26
|
end
|
25
27
|
|
26
28
|
def test_execute_yaml
|
27
|
-
|
28
|
-
|
29
|
-
gemspec_file = File.join(@tempdir, "#{gem.full_name}.gemspec")
|
29
|
+
gemspec_file = File.join(@tempdir, "#{@gem.full_name}.gemspec")
|
30
30
|
|
31
31
|
File.open gemspec_file, 'w' do |gs|
|
32
|
-
gs.write gem.to_yaml
|
32
|
+
gs.write @gem.to_yaml
|
33
33
|
end
|
34
34
|
|
35
|
-
util_test_build_gem gem, gemspec_file
|
35
|
+
util_test_build_gem @gem, gemspec_file
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_execute_bad_gem
|
@@ -57,8 +57,8 @@ class TestGemCommandsBuildCommand < RubyGemTestCase
|
|
57
57
|
output = @ui.output.split "\n"
|
58
58
|
assert_equal " Successfully built RubyGem", output.shift
|
59
59
|
assert_equal " Name: some_gem", output.shift
|
60
|
-
assert_equal " Version:
|
61
|
-
assert_equal " File: some_gem-
|
60
|
+
assert_equal " Version: 2", output.shift
|
61
|
+
assert_equal " File: some_gem-2.gem", output.shift
|
62
62
|
assert_equal [], output
|
63
63
|
assert_equal '', @ui.error
|
64
64
|
|
@@ -13,7 +13,7 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
13
13
|
|
14
14
|
def test_execute
|
15
15
|
quick_gem 'foo' do |gem|
|
16
|
-
gem.add_dependency 'bar', '> 1
|
16
|
+
gem.add_dependency 'bar', '> 1'
|
17
17
|
end
|
18
18
|
|
19
19
|
@cmd.options[:args] = %w[foo]
|
@@ -22,7 +22,7 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
22
22
|
@cmd.execute
|
23
23
|
end
|
24
24
|
|
25
|
-
assert_equal "Gem foo-
|
25
|
+
assert_equal "Gem foo-2\n bar (> 1)\n\n", @ui.output
|
26
26
|
assert_equal '', @ui.error
|
27
27
|
end
|
28
28
|
|
@@ -41,7 +41,7 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
41
41
|
|
42
42
|
def test_execute_pipe_format
|
43
43
|
quick_gem 'foo' do |gem|
|
44
|
-
gem.add_dependency 'bar', '> 1
|
44
|
+
gem.add_dependency 'bar', '> 1'
|
45
45
|
end
|
46
46
|
|
47
47
|
@cmd.options[:args] = %w[foo]
|
@@ -51,13 +51,13 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
51
51
|
@cmd.execute
|
52
52
|
end
|
53
53
|
|
54
|
-
assert_equal "bar --version '> 1
|
54
|
+
assert_equal "bar --version '> 1'\n", @ui.output
|
55
55
|
assert_equal '', @ui.error
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_execute_reverse
|
59
59
|
quick_gem 'foo' do |gem|
|
60
|
-
gem.add_dependency 'bar', '> 1
|
60
|
+
gem.add_dependency 'bar', '> 1'
|
61
61
|
end
|
62
62
|
|
63
63
|
quick_gem 'baz' do |gem|
|
@@ -72,10 +72,10 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|
72
72
|
end
|
73
73
|
|
74
74
|
expected = <<-EOF
|
75
|
-
Gem foo-
|
76
|
-
bar (> 1
|
75
|
+
Gem foo-2
|
76
|
+
bar (> 1)
|
77
77
|
Used by
|
78
|
-
baz-
|
78
|
+
baz-2 (foo (>= 0))
|
79
79
|
|
80
80
|
EOF
|
81
81
|
|
@@ -85,7 +85,7 @@ Gem foo-0.0.2
|
|
85
85
|
|
86
86
|
def test_execute_remote
|
87
87
|
foo = quick_gem 'foo' do |gem|
|
88
|
-
gem.add_dependency 'bar', '> 1
|
88
|
+
gem.add_dependency 'bar', '> 1'
|
89
89
|
end
|
90
90
|
|
91
91
|
util_setup_source_info_cache foo
|
@@ -100,7 +100,7 @@ Gem foo-0.0.2
|
|
100
100
|
@cmd.execute
|
101
101
|
end
|
102
102
|
|
103
|
-
assert_equal "Gem foo-
|
103
|
+
assert_equal "Gem foo-2\n bar (> 1)\n\n", @ui.output
|
104
104
|
assert_equal '', @ui.error
|
105
105
|
end
|
106
106
|
|
@@ -34,7 +34,12 @@ class TestGemCommandsMirrorCommand < RubyGemTestCase
|
|
34
34
|
|
35
35
|
File.open File.join(Gem.user_home, '.gemmirrorrc'), 'w' do |fp|
|
36
36
|
fp.puts "---"
|
37
|
-
|
37
|
+
# tempdir could be a drive+path (under windows)
|
38
|
+
if @tempdir.match(/[a-z]:/i)
|
39
|
+
fp.puts "- from: file:///#{@tempdir}"
|
40
|
+
else
|
41
|
+
fp.puts "- from: file://#{@tempdir}"
|
42
|
+
end
|
38
43
|
fp.puts " to: #{mirror}"
|
39
44
|
end
|
40
45
|
|
@@ -42,9 +47,9 @@ class TestGemCommandsMirrorCommand < RubyGemTestCase
|
|
42
47
|
@cmd.execute
|
43
48
|
end
|
44
49
|
|
45
|
-
assert File.exist?(File.join(mirror, 'gems', "#{@
|
46
|
-
assert File.exist?(File.join(mirror, 'gems', "#{@
|
47
|
-
assert File.exist?(File.join(mirror, 'gems', "#{@
|
50
|
+
assert File.exist?(File.join(mirror, 'gems', "#{@a1.full_name}.gem"))
|
51
|
+
assert File.exist?(File.join(mirror, 'gems', "#{@a2.full_name}.gem"))
|
52
|
+
assert File.exist?(File.join(mirror, 'gems', "#{@b2.full_name}.gem"))
|
48
53
|
assert File.exist?(File.join(mirror, 'gems', "#{@c1_2.full_name}.gem"))
|
49
54
|
assert File.exist?(File.join(mirror, "Marshal.#{@marshal_version}"))
|
50
55
|
ensure
|
@@ -10,13 +10,17 @@ class TestGemCommandsQueryCommand < RubyGemTestCase
|
|
10
10
|
@foo_gem = quick_gem 'foo' do |spec|
|
11
11
|
spec.summary = 'This is a lot of text. ' * 5
|
12
12
|
end
|
13
|
+
@foo_gem_p = quick_gem 'foo' do |spec|
|
14
|
+
spec.summary = 'This is a lot of text. ' * 5
|
15
|
+
spec.platform = Gem::Platform::CURRENT
|
16
|
+
end
|
13
17
|
@bar_gem = quick_gem 'bar'
|
14
18
|
|
15
19
|
@cmd = Gem::Commands::QueryCommand.new
|
16
20
|
end
|
17
21
|
|
18
22
|
def test_execute
|
19
|
-
util_setup_source_info_cache @foo_gem
|
23
|
+
util_setup_source_info_cache @foo_gem, @foo_gem_p
|
20
24
|
|
21
25
|
@cmd.handle_options %w[-r]
|
22
26
|
|
@@ -28,7 +32,7 @@ class TestGemCommandsQueryCommand < RubyGemTestCase
|
|
28
32
|
|
29
33
|
*** REMOTE GEMS ***
|
30
34
|
|
31
|
-
foo (
|
35
|
+
foo (2)
|
32
36
|
EOF
|
33
37
|
|
34
38
|
assert_equal expected, @ui.output
|
@@ -48,7 +52,7 @@ foo (0.0.2)
|
|
48
52
|
|
49
53
|
*** REMOTE GEMS ***
|
50
54
|
|
51
|
-
foo (
|
55
|
+
foo (2)
|
52
56
|
This is a lot of text. This is a lot of text. This is a lot of
|
53
57
|
text. This is a lot of text. This is a lot of text.
|
54
58
|
EOF
|