rubygems-update 1.7.2 → 1.8.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.

Files changed (104) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +5 -1
  3. data/History.txt +101 -4
  4. data/LICENSE.txt +42 -37
  5. data/MIT.txt +20 -0
  6. data/Manifest.txt +5 -4
  7. data/Rakefile +6 -7
  8. data/lib/rubygems.rb +175 -278
  9. data/lib/rubygems/builder.rb +7 -6
  10. data/lib/rubygems/command_manager.rb +16 -2
  11. data/lib/rubygems/commands/build_command.rb +13 -11
  12. data/lib/rubygems/commands/cert_command.rb +1 -1
  13. data/lib/rubygems/commands/cleanup_command.rb +10 -19
  14. data/lib/rubygems/commands/contents_command.rb +5 -5
  15. data/lib/rubygems/commands/dependency_command.rb +17 -40
  16. data/lib/rubygems/commands/fetch_command.rb +1 -1
  17. data/lib/rubygems/commands/install_command.rb +2 -1
  18. data/lib/rubygems/commands/lock_command.rb +4 -4
  19. data/lib/rubygems/commands/outdated_command.rb +18 -6
  20. data/lib/rubygems/commands/pristine_command.rb +25 -15
  21. data/lib/rubygems/commands/query_command.rb +9 -6
  22. data/lib/rubygems/commands/setup_command.rb +1 -1
  23. data/lib/rubygems/commands/specification_command.rb +8 -23
  24. data/lib/rubygems/commands/stale_command.rb +2 -1
  25. data/lib/rubygems/commands/unpack_command.rb +7 -5
  26. data/lib/rubygems/commands/update_command.rb +2 -4
  27. data/lib/rubygems/commands/which_command.rb +5 -9
  28. data/lib/rubygems/config_file.rb +9 -7
  29. data/lib/rubygems/custom_require.rb +6 -4
  30. data/lib/rubygems/defaults.rb +30 -14
  31. data/lib/rubygems/dependency.rb +44 -1
  32. data/lib/rubygems/dependency_installer.rb +37 -41
  33. data/lib/rubygems/dependency_list.rb +20 -9
  34. data/lib/rubygems/deprecate.rb +3 -3
  35. data/lib/rubygems/doc_manager.rb +10 -11
  36. data/lib/rubygems/ext/rake_builder.rb +1 -1
  37. data/lib/rubygems/gem_path_searcher.rb +19 -4
  38. data/lib/rubygems/gem_runner.rb +1 -1
  39. data/lib/rubygems/indexer.rb +117 -123
  40. data/lib/rubygems/installer.rb +101 -94
  41. data/lib/rubygems/installer_test_case.rb +28 -30
  42. data/lib/rubygems/local_remote_options.rb +1 -1
  43. data/lib/rubygems/mock_gem_ui.rb +10 -3
  44. data/lib/rubygems/package.rb +0 -26
  45. data/lib/rubygems/package/tar_input.rb +5 -6
  46. data/lib/rubygems/package_task.rb +1 -1
  47. data/lib/rubygems/path_support.rb +72 -0
  48. data/lib/rubygems/platform.rb +12 -2
  49. data/lib/rubygems/remote_fetcher.rb +7 -6
  50. data/lib/rubygems/requirement.rb +3 -0
  51. data/lib/rubygems/security.rb +1 -1
  52. data/lib/rubygems/server.rb +67 -67
  53. data/lib/rubygems/source_index.rb +58 -29
  54. data/lib/rubygems/spec_fetcher.rb +5 -1
  55. data/lib/rubygems/specification.rb +1422 -877
  56. data/lib/rubygems/test_case.rb +114 -64
  57. data/lib/rubygems/test_utilities.rb +4 -3
  58. data/lib/rubygems/text.rb +1 -1
  59. data/lib/rubygems/uninstaller.rb +37 -44
  60. data/test/rubygems/test_gem.rb +131 -102
  61. data/test/rubygems/test_gem_builder.rb +18 -1
  62. data/test/rubygems/test_gem_command_manager.rb +2 -0
  63. data/test/rubygems/test_gem_commands_build_command.rb +31 -3
  64. data/test/rubygems/test_gem_commands_cleanup_command.rb +51 -0
  65. data/test/rubygems/test_gem_commands_dependency_command.rb +1 -10
  66. data/test/rubygems/test_gem_commands_fetch_command.rb +5 -4
  67. data/test/rubygems/test_gem_commands_help_command.rb +58 -0
  68. data/test/rubygems/test_gem_commands_install_command.rb +25 -24
  69. data/test/rubygems/test_gem_commands_list_command.rb +1 -4
  70. data/test/rubygems/test_gem_commands_outdated_command.rb +10 -9
  71. data/test/rubygems/test_gem_commands_pristine_command.rb +63 -22
  72. data/test/rubygems/test_gem_commands_push_command.rb +1 -1
  73. data/test/rubygems/test_gem_commands_query_command.rb +15 -82
  74. data/test/rubygems/test_gem_commands_sources_command.rb +8 -9
  75. data/test/rubygems/test_gem_commands_specification_command.rb +10 -6
  76. data/test/rubygems/test_gem_commands_stale_command.rb +4 -4
  77. data/test/rubygems/test_gem_commands_unpack_command.rb +20 -21
  78. data/test/rubygems/test_gem_commands_update_command.rb +19 -23
  79. data/test/rubygems/test_gem_commands_which_command.rb +7 -4
  80. data/test/rubygems/test_gem_dependency.rb +14 -8
  81. data/test/rubygems/test_gem_dependency_installer.rb +87 -33
  82. data/test/rubygems/test_gem_dependency_list.rb +7 -3
  83. data/test/rubygems/test_gem_doc_manager.rb +3 -3
  84. data/test/rubygems/test_gem_format.rb +1 -1
  85. data/test/rubygems/test_gem_gem_path_searcher.rb +45 -29
  86. data/test/rubygems/test_gem_indexer.rb +48 -47
  87. data/test/rubygems/test_gem_install_update_options.rb +6 -5
  88. data/test/rubygems/test_gem_installer.rb +61 -37
  89. data/test/rubygems/test_gem_path_support.rb +58 -0
  90. data/test/rubygems/test_gem_platform.rb +5 -5
  91. data/test/rubygems/test_gem_remote_fetcher.rb +18 -21
  92. data/test/rubygems/test_gem_server.rb +23 -15
  93. data/test/rubygems/test_gem_source_index.rb +165 -127
  94. data/test/rubygems/test_gem_spec_fetcher.rb +42 -49
  95. data/test/rubygems/test_gem_specification.rb +104 -74
  96. data/test/rubygems/test_gem_text.rb +15 -0
  97. data/test/rubygems/test_gem_uninstaller.rb +15 -26
  98. data/test/rubygems/test_kernel.rb +1 -2
  99. metadata +64 -14
  100. metadata.gz.sig +0 -0
  101. data/GPL.txt +0 -340
  102. data/pkgs/sources/lib/sources.rb +0 -3
  103. data/pkgs/sources/sources.gemspec +0 -14
  104. data/test/rubygems/functional.rb +0 -92
@@ -14,24 +14,25 @@ class TestGemCommandsOutdatedCommand < Gem::TestCase
14
14
  end
15
15
 
16
16
  def test_execute
17
- quick_gem 'foo', '0.1'
18
- quick_gem 'foo', '0.2'
19
17
  remote_10 = quick_spec 'foo', '1.0'
20
18
  remote_20 = quick_spec 'foo', '2.0'
21
19
 
22
- remote_spec_file = File.join @gemhome, 'specifications', remote_10.spec_name
23
- remote_spec_file = File.join @gemhome, 'specifications', remote_20.spec_name
24
-
25
- @fetcher = Gem::FakeFetcher.new
26
- Gem::RemoteFetcher.fetcher = @fetcher
20
+ Gem::RemoteFetcher.fetcher = @fetcher = Gem::FakeFetcher.new
27
21
 
22
+ util_clear_gems
28
23
  util_setup_spec_fetcher remote_10, remote_20
29
24
 
30
- use_ui @ui do @cmd.execute end
25
+ quick_gem 'foo', '0.1'
26
+ quick_gem 'foo', '0.2'
27
+
28
+ Gem::Specification.reset
29
+
30
+ use_ui @ui do
31
+ @cmd.execute
32
+ end
31
33
 
32
34
  assert_equal "foo (0.2 < 2.0)\n", @ui.output
33
35
  assert_equal "", @ui.error
34
36
  end
35
-
36
37
  end
37
38
 
@@ -10,8 +10,8 @@ class TestGemCommandsPristineCommand < Gem::TestCase
10
10
 
11
11
  def test_execute
12
12
  a = quick_spec 'a' do |s| s.executables = %w[foo] end
13
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
14
- File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
13
+
14
+ write_file File.join(@tempdir, 'bin', 'foo') do |fp|
15
15
  fp.puts "#!/usr/bin/ruby"
16
16
  end
17
17
 
@@ -19,7 +19,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
19
19
 
20
20
  foo_path = File.join @gemhome, 'gems', a.full_name, 'bin', 'foo'
21
21
 
22
- File.open foo_path, 'w' do |io|
22
+ write_file foo_path do |io|
23
23
  io.puts 'I changed it!'
24
24
  end
25
25
 
@@ -33,15 +33,14 @@ class TestGemCommandsPristineCommand < Gem::TestCase
33
33
 
34
34
  out = @ui.output.split "\n"
35
35
 
36
- assert_equal "Restoring gem(s) to pristine condition...", out.shift
36
+ assert_equal "Restoring gems to pristine condition...", out.shift
37
37
  assert_equal "Restored #{a.full_name}", out.shift
38
38
  assert_empty out, out.inspect
39
39
  end
40
40
 
41
41
  def test_execute_all
42
42
  a = quick_spec 'a' do |s| s.executables = %w[foo] end
43
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
44
- File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
43
+ write_file File.join(@tempdir, 'bin', 'foo') do |fp|
45
44
  fp.puts "#!/usr/bin/ruby"
46
45
  end
47
46
 
@@ -61,35 +60,76 @@ class TestGemCommandsPristineCommand < Gem::TestCase
61
60
 
62
61
  out = @ui.output.split "\n"
63
62
 
64
- assert_equal "Restoring gem(s) to pristine condition...", out.shift
63
+ assert_equal "Restoring gems to pristine condition...", out.shift
65
64
  assert_equal "Restored #{a.full_name}", out.shift
66
65
  assert_empty out, out.inspect
67
66
  end
68
67
 
69
- def test_execute_missing_cache_gem
70
- a = quick_spec 'a' do |s|
71
- s.executables = %w[foo]
68
+ def test_execute_no_exetension
69
+ a = quick_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
70
+
71
+ ext_path = File.join @tempdir, 'ext', 'a', 'extconf.rb'
72
+ write_file ext_path do |io|
73
+ io.write '# extconf.rb'
72
74
  end
73
75
 
74
- FileUtils.mkdir_p File.join(@tempdir, 'bin')
76
+ util_build_gem a
75
77
 
76
- File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
77
- fp.puts "#!/usr/bin/ruby"
78
+ @cmd.options[:args] = %w[a]
79
+ @cmd.options[:extensions] = false
80
+
81
+ use_ui @ui do
82
+ @cmd.execute
78
83
  end
79
84
 
85
+ out = @ui.output.split "\n"
86
+
87
+ assert_equal 'Restoring gems to pristine condition...', out.shift
88
+ assert_equal "Skipped #{a.full_name}, it needs to compile an extension",
89
+ out.shift
90
+ assert_empty out, out.inspect
91
+ end
92
+
93
+ def test_execute_many
94
+ a = quick_spec 'a'
95
+ b = quick_spec 'b'
96
+
80
97
  install_gem a
98
+ install_gem b
99
+
100
+ @cmd.options[:args] = %w[a b]
101
+
102
+ use_ui @ui do
103
+ @cmd.execute
104
+ end
105
+
106
+ out = @ui.output.split "\n"
107
+
108
+ assert_equal "Restoring gems to pristine condition...", out.shift
109
+ assert_equal "Restored #{a.full_name}", out.shift
110
+ assert_equal "Restored #{b.full_name}", out.shift
111
+ assert_empty out, out.inspect
112
+ end
113
+
114
+ def test_execute_missing_cache_gem
115
+ a_2 = quick_spec 'a', 2
116
+ a_3 = quick_spec 'a', 3
117
+
118
+ install_gem a_2
119
+ install_gem a_3
81
120
 
82
- a_data = nil
83
- open File.join(@gemhome, 'cache', a.file_name), 'rb' do |fp|
84
- a_data = fp.read
121
+ a_2_data = nil
122
+ open File.join(@gemhome, 'cache', a_2.file_name), 'rb' do |fp|
123
+ a_2_data = fp.read
85
124
  end
86
125
 
87
126
  util_setup_fake_fetcher
88
- util_setup_spec_fetcher a
127
+ util_setup_spec_fetcher a_2
89
128
 
90
- Gem::RemoteFetcher.fetcher.data["http://gems.example.com/gems/#{a.file_name}"] = a_data
129
+ url = "http://gems.example.com/gems/#{a_2.file_name}"
130
+ Gem::RemoteFetcher.fetcher.data[url] = a_2_data
91
131
 
92
- FileUtils.rm Gem.cache_gem(a.file_name, @gemhome)
132
+ FileUtils.rm a_2.cache_file
93
133
 
94
134
  @cmd.options[:args] = %w[a]
95
135
 
@@ -100,11 +140,12 @@ class TestGemCommandsPristineCommand < Gem::TestCase
100
140
  out = @ui.output.split "\n"
101
141
 
102
142
  [
103
- "Restoring gem\(s\) to pristine condition...",
143
+ "Restoring gems to pristine condition...",
104
144
  "Restored a-1",
105
145
  "Cached gem for a-2 not found, attempting to fetch...",
106
146
  "Restored a-2",
107
- "Restored a-3.a"
147
+ "Restored a-3.a",
148
+ "Restored a-3",
108
149
  ].each do |line|
109
150
  assert_equal line, out.shift
110
151
  end
@@ -121,7 +162,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
121
162
  end
122
163
  end
123
164
 
124
- assert_match %r|specify a gem name|, e.message
165
+ assert_match %r|at least one gem name|, e.message
125
166
  end
126
167
 
127
168
  end
@@ -15,7 +15,7 @@ class TestGemCommandsPushCommand < Gem::TestCase
15
15
  super
16
16
 
17
17
  @gems_dir = File.join @tempdir, 'gems'
18
- @cache_dir = Gem.cache_dir @gemhome
18
+ @cache_dir = File.join @gemhome, "cache"
19
19
 
20
20
  FileUtils.mkdir @gems_dir
21
21
 
@@ -9,8 +9,8 @@ class TestGemCommandsQueryCommand < Gem::TestCase
9
9
  @cmd = Gem::Commands::QueryCommand.new
10
10
 
11
11
  util_setup_fake_fetcher
12
-
13
- @si = util_setup_spec_fetcher @a1, @a2, @pl1, @a3a
12
+ util_clear_gems
13
+ util_setup_spec_fetcher @a1, @a2, @pl1, @a3a
14
14
 
15
15
  @fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] = proc do
16
16
  raise Gem::RemoteFetcher::FetchError
@@ -42,7 +42,8 @@ pl (1 i386-linux)
42
42
  @a1.platform = 'x86-linux'
43
43
  @a2.platform = 'universal-darwin'
44
44
 
45
- @si = util_setup_spec_fetcher @a1, @a1r, @a2, @b2, @pl1
45
+ util_clear_gems
46
+ util_setup_spec_fetcher @a1, @a1r, @a2, @b2, @pl1
46
47
 
47
48
  @cmd.handle_options %w[-r -a]
48
49
 
@@ -107,7 +108,8 @@ pl (1 i386-linux)
107
108
  @a2.homepage = 'http://a.example.com/'
108
109
  @a2.rubyforge_project = 'rubygems'
109
110
 
110
- @si = util_setup_spec_fetcher @a1, @a2, @pl1
111
+ util_clear_gems
112
+ util_setup_spec_fetcher @a1, @a2, @pl1
111
113
 
112
114
  @cmd.handle_options %w[-r -d]
113
115
 
@@ -148,7 +150,8 @@ pl (1)
148
150
  @a2.rubyforge_project = 'rubygems'
149
151
  @a2.platform = 'universal-darwin'
150
152
 
151
- @si = util_setup_spec_fetcher @a1, @a2, @pl1
153
+ util_clear_gems
154
+ util_setup_spec_fetcher @a1, @a2, @pl1
152
155
 
153
156
  @cmd.handle_options %w[-r -d]
154
157
 
@@ -184,25 +187,22 @@ pl (1)
184
187
  end
185
188
 
186
189
  def test_execute_installed
187
- @cmd.handle_options %w[-n c --installed]
190
+ @cmd.handle_options %w[-n a --installed]
188
191
 
189
- e = assert_raises Gem::SystemExitException do
192
+ assert_raises Gem::MockGemUi::SystemExitException do
190
193
  use_ui @ui do
191
194
  @cmd.execute
192
195
  end
193
196
  end
194
197
 
195
- assert_equal 0, e.exit_code
196
-
197
198
  assert_equal "true\n", @ui.output
198
-
199
199
  assert_equal '', @ui.error
200
200
  end
201
201
 
202
202
  def test_execute_installed_no_name
203
203
  @cmd.handle_options %w[--installed]
204
204
 
205
- e = assert_raises Gem::SystemExitException do
205
+ e = assert_raises Gem::MockGemUi::TermError do
206
206
  use_ui @ui do
207
207
  @cmd.execute
208
208
  end
@@ -217,7 +217,7 @@ pl (1)
217
217
  def test_execute_installed_not_installed
218
218
  @cmd.handle_options %w[-n not_installed --installed]
219
219
 
220
- e = assert_raises Gem::SystemExitException do
220
+ e = assert_raises Gem::MockGemUi::TermError do
221
221
  use_ui @ui do
222
222
  @cmd.execute
223
223
  end
@@ -230,9 +230,9 @@ pl (1)
230
230
  end
231
231
 
232
232
  def test_execute_installed_version
233
- @cmd.handle_options %w[-n c --installed --version 1.2]
233
+ @cmd.handle_options %w[-n a --installed --version 2]
234
234
 
235
- e = assert_raises Gem::SystemExitException do
235
+ assert_raises Gem::MockGemUi::SystemExitException do
236
236
  use_ui @ui do
237
237
  @cmd.execute
238
238
  end
@@ -240,14 +240,12 @@ pl (1)
240
240
 
241
241
  assert_equal "true\n", @ui.output
242
242
  assert_equal '', @ui.error
243
-
244
- assert_equal 0, e.exit_code
245
243
  end
246
244
 
247
245
  def test_execute_installed_version_not_installed
248
246
  @cmd.handle_options %w[-n c --installed --version 2]
249
247
 
250
- e = assert_raises Gem::SystemExitException do
248
+ e = assert_raises Gem::MockGemUi::TermError do
251
249
  use_ui @ui do
252
250
  @cmd.execute
253
251
  end
@@ -259,65 +257,6 @@ pl (1)
259
257
  assert_equal 1, e.exit_code
260
258
  end
261
259
 
262
- def test_execute_local_details
263
- @a3a.summary = 'This is a lot of text. ' * 4
264
- @a3a.authors = ['Abraham Lincoln', 'Hirohito']
265
- @a3a.homepage = 'http://a.example.com/'
266
- @a3a.rubyforge_project = 'rubygems'
267
-
268
- @cmd.handle_options %w[--local --details]
269
-
270
- use_ui @ui do
271
- @cmd.execute
272
- end
273
-
274
- expected = <<-EOF
275
-
276
- *** LOCAL GEMS ***
277
-
278
- a (3.a, 2, 1)
279
- Author: A User
280
- Homepage: http://example.com
281
- Installed at (3.a): #{@gemhome}
282
- (2): #{@gemhome}
283
- (1): #{@gemhome}
284
-
285
- this is a summary
286
-
287
- a_evil (9)
288
- Author: A User
289
- Homepage: http://example.com
290
- Installed at: #{@gemhome}
291
-
292
- this is a summary
293
-
294
- b (2)
295
- Author: A User
296
- Homepage: http://example.com
297
- Installed at: #{@gemhome}
298
-
299
- this is a summary
300
-
301
- c (1.2)
302
- Author: A User
303
- Homepage: http://example.com
304
- Installed at: #{@gemhome}
305
-
306
- this is a summary
307
-
308
- pl (1)
309
- Platform: i386-linux
310
- Author: A User
311
- Homepage: http://example.com
312
- Installed at: #{@gemhome}
313
-
314
- this is a summary
315
- EOF
316
-
317
- assert_equal expected, @ui.output
318
- assert_equal '', @ui.error
319
- end
320
-
321
260
  def test_execute_local_notty
322
261
  @cmd.handle_options %w[]
323
262
 
@@ -329,9 +268,6 @@ pl (1)
329
268
 
330
269
  expected = <<-EOF
331
270
  a (3.a, 2, 1)
332
- a_evil (9)
333
- b (2)
334
- c (1.2)
335
271
  pl (1 i386-linux)
336
272
  EOF
337
273
 
@@ -406,9 +342,6 @@ a (3.a)
406
342
  *** LOCAL GEMS ***
407
343
 
408
344
  a (3.a, 2, 1)
409
- a_evil (9)
410
- b (2)
411
- c (1.2)
412
345
  pl (1 i386-linux)
413
346
  EOF
414
347
 
@@ -36,12 +36,11 @@ class TestGemCommandsSourcesCommand < Gem::TestCase
36
36
  def test_execute_add
37
37
  util_setup_fake_fetcher
38
38
 
39
- si = Gem::SourceIndex.new
40
- si.add_spec @a1
39
+ install_specs @a1
41
40
 
42
- specs = si.map do |_, spec|
41
+ specs = Gem::Specification.map { |spec|
43
42
  [spec.name, spec.version, spec.original_platform]
44
- end
43
+ }
45
44
 
46
45
  specs_dump_gz = StringIO.new
47
46
  Zlib::GzipWriter.wrap specs_dump_gz do |io|
@@ -181,18 +180,18 @@ beta-gems.example.com is not a URI
181
180
  @cmd.handle_options %w[--update]
182
181
 
183
182
  util_setup_fake_fetcher
184
- source_index = util_setup_spec_fetcher @a1
183
+ util_setup_spec_fetcher @a1
185
184
 
186
- specs = source_index.map do |name, spec|
185
+ specs = Gem::Specification.map { |spec|
187
186
  [spec.name, spec.version, spec.original_platform]
188
- end
187
+ }
189
188
 
190
189
  @fetcher.data["#{@gem_repo}specs.#{Gem.marshal_version}.gz"] =
191
190
  util_gzip Marshal.dump(specs)
192
191
 
193
- latest_specs = source_index.latest_specs.map do |spec|
192
+ latest_specs = Gem::Specification.latest_specs.map { |spec|
194
193
  [spec.name, spec.version, spec.original_platform]
195
- end
194
+ }
196
195
 
197
196
  @fetcher.data["#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"] =
198
197
  util_gzip Marshal.dump(latest_specs)
@@ -11,7 +11,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
11
11
 
12
12
  def test_execute
13
13
  foo = quick_spec 'foo'
14
- Gem.source_index.add_spec foo
14
+
15
+ install_specs foo
15
16
 
16
17
  @cmd.options[:args] = %w[foo]
17
18
 
@@ -71,8 +72,9 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
71
72
  end
72
73
 
73
74
  def test_execute_field
74
- foo = quick_spec 'foo'
75
- Gem.source_index.add_spec foo
75
+ foo = new_spec 'foo', '2'
76
+
77
+ install_specs foo
76
78
 
77
79
  @cmd.options[:args] = %w[foo name]
78
80
 
@@ -84,8 +86,9 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
84
86
  end
85
87
 
86
88
  def test_execute_marshal
87
- foo = quick_spec 'foo'
88
- Gem.source_index.add_spec foo
89
+ foo = new_spec 'foo', '2'
90
+
91
+ install_specs foo
89
92
 
90
93
  @cmd.options[:args] = %w[foo]
91
94
  @cmd.options[:format] = :marshal
@@ -121,7 +124,8 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
121
124
 
122
125
  def test_execute_ruby
123
126
  foo = quick_spec 'foo'
124
- Gem.source_index.add_spec foo
127
+
128
+ install_specs foo
125
129
 
126
130
  @cmd.options[:args] = %w[foo]
127
131
  @cmd.options[:format] = :ruby