rubygems-update 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/ChangeLog +31 -0
- data/doc/release_notes/rel_1_3_1.rdoc +75 -0
- data/lib/rubygems.rb +23 -13
- data/lib/rubygems/commands/check_command.rb +2 -1
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +4 -5
- data/lib/rubygems/config_file.rb +4 -1
- data/lib/rubygems/custom_require.rb +15 -7
- data/lib/rubygems/defaults.rb +5 -0
- data/lib/rubygems/installer.rb +1 -1
- data/lib/rubygems/rubygems_version.rb +1 -1
- data/lib/rubygems/source_index.rb +1 -2
- data/lib/rubygems/validator.rb +147 -125
- data/test/functional.rb +6 -2
- data/test/gem_installer_test_case.rb +1 -1
- data/test/gemutilities.rb +19 -5
- data/test/test_config.rb +0 -2
- data/test/test_gem.rb +4 -4
- data/test/test_gem_builder.rb +0 -1
- data/test/test_gem_command.rb +2 -3
- data/test/test_gem_command_manager.rb +0 -1
- data/test/test_gem_commands_build_command.rb +0 -1
- data/test/test_gem_commands_cert_command.rb +0 -1
- data/test/test_gem_commands_check_command.rb +0 -1
- data/test/test_gem_commands_contents_command.rb +2 -3
- data/test/test_gem_commands_dependency_command.rb +2 -3
- data/test/test_gem_commands_environment_command.rb +1 -2
- data/test/test_gem_commands_fetch_command.rb +0 -1
- data/test/test_gem_commands_generate_index_command.rb +1 -1
- data/test/test_gem_commands_install_command.rb +2 -3
- data/test/test_gem_commands_list_command.rb +1 -2
- data/test/test_gem_commands_lock_command.rb +1 -2
- data/test/test_gem_commands_mirror_command.rb +0 -1
- data/test/test_gem_commands_outdated_command.rb +0 -1
- data/test/test_gem_commands_pristine_command.rb +1 -2
- data/test/test_gem_commands_query_command.rb +5 -6
- data/test/test_gem_commands_server_command.rb +0 -1
- data/test/test_gem_commands_sources_command.rb +0 -1
- data/test/test_gem_commands_specification_command.rb +1 -2
- data/test/test_gem_commands_stale_command.rb +0 -1
- data/test/test_gem_commands_uninstall_command.rb +5 -4
- data/test/test_gem_commands_unpack_command.rb +0 -1
- data/test/test_gem_commands_update_command.rb +0 -1
- data/test/test_gem_config_file.rb +0 -2
- data/test/test_gem_dependency.rb +13 -14
- data/test/test_gem_dependency_installer.rb +4 -5
- data/test/test_gem_dependency_list.rb +0 -3
- data/test/test_gem_digest.rb +12 -10
- data/test/test_gem_doc_manager.rb +1 -2
- data/test/test_gem_ext_configure_builder.rb +1 -2
- data/test/test_gem_ext_ext_conf_builder.rb +2 -3
- data/test/test_gem_ext_rake_builder.rb +2 -3
- data/test/test_gem_format.rb +4 -6
- data/test/test_gem_gem_path_searcher.rb +0 -1
- data/test/test_gem_gem_runner.rb +0 -1
- data/test/test_gem_indexer.rb +2 -3
- data/test/test_gem_install_update_options.rb +1 -2
- data/test/test_gem_installer.rb +16 -15
- data/test/test_gem_local_remote_options.rb +1 -2
- data/test/test_gem_package_tar_reader_entry.rb +5 -5
- data/test/test_gem_package_tar_writer.rb +10 -10
- data/test/test_gem_platform.rb +6 -19
- data/test/test_gem_remote_fetcher.rb +18 -12
- data/test/test_gem_requirement.rb +14 -15
- data/test/test_gem_server.rb +0 -1
- data/test/test_gem_source_index.rb +5 -6
- data/test/test_gem_source_info_cache.rb +5 -7
- data/test/test_gem_source_info_cache_entry.rb +1 -2
- data/test/test_gem_spec_fetcher.rb +0 -1
- data/test/test_gem_specification.rb +11 -12
- data/test/test_gem_stream_ui.rb +0 -1
- data/test/test_gem_validator.rb +4 -5
- data/test/test_gem_version.rb +9 -10
- data/test/test_gem_version_option.rb +0 -1
- data/test/test_kernel.rb +1 -3
- metadata +4 -3
- metadata.gz.sig +0 -0
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/local_remote_options'
|
4
3
|
require 'rubygems/command'
|
@@ -86,7 +85,7 @@ class TestGemLocalRemoteOptions < RubyGemTestCase
|
|
86
85
|
|
87
86
|
s1 = 'htp://more-gems.example.com'
|
88
87
|
|
89
|
-
|
88
|
+
assert_raises OptionParser::InvalidArgument do
|
90
89
|
@cmd.handle_options %W[--source #{s1}]
|
91
90
|
end
|
92
91
|
|
@@ -36,19 +36,19 @@ class TestGemPackageTarReaderEntry < TarTestCase
|
|
36
36
|
|
37
37
|
assert @entry.bytes_read
|
38
38
|
|
39
|
-
e =
|
39
|
+
e = assert_raises IOError do @entry.eof? end
|
40
40
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
41
41
|
|
42
|
-
e =
|
42
|
+
e = assert_raises IOError do @entry.getc end
|
43
43
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
44
44
|
|
45
|
-
e =
|
45
|
+
e = assert_raises IOError do @entry.pos end
|
46
46
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
47
47
|
|
48
|
-
e =
|
48
|
+
e = assert_raises IOError do @entry.read end
|
49
49
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
50
50
|
|
51
|
-
e =
|
51
|
+
e = assert_raises IOError do @entry.rewind end
|
52
52
|
assert_equal 'closed Gem::Package::TarReader::Entry', e.message
|
53
53
|
end
|
54
54
|
|
@@ -61,7 +61,7 @@ class TestTarWriter < TarTestCase
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def test_add_file_simple_size
|
64
|
-
|
64
|
+
assert_raises Gem::Package::TarWriter::FileOverflow do
|
65
65
|
@tar_writer.add_file_simple("lib/foo/bar", 0, 10) do |io|
|
66
66
|
io.write "1" * 11
|
67
67
|
end
|
@@ -69,7 +69,7 @@ class TestTarWriter < TarTestCase
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def test_add_file_unseekable
|
72
|
-
|
72
|
+
assert_raises Gem::Package::NonSeekableIO do
|
73
73
|
Gem::Package::TarWriter.new(Object.new).add_file 'x', 0
|
74
74
|
end
|
75
75
|
end
|
@@ -79,27 +79,27 @@ class TestTarWriter < TarTestCase
|
|
79
79
|
|
80
80
|
assert_equal "\0" * 1024, @io.string
|
81
81
|
|
82
|
-
e =
|
82
|
+
e = assert_raises IOError do
|
83
83
|
@tar_writer.close
|
84
84
|
end
|
85
85
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
86
86
|
|
87
|
-
e =
|
87
|
+
e = assert_raises IOError do
|
88
88
|
@tar_writer.flush
|
89
89
|
end
|
90
90
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
91
91
|
|
92
|
-
e =
|
92
|
+
e = assert_raises IOError do
|
93
93
|
@tar_writer.add_file 'x', 0
|
94
94
|
end
|
95
95
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
96
96
|
|
97
|
-
e =
|
97
|
+
e = assert_raises IOError do
|
98
98
|
@tar_writer.add_file_simple 'x', 0, 0
|
99
99
|
end
|
100
100
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
101
101
|
|
102
|
-
e =
|
102
|
+
e = assert_raises IOError do
|
103
103
|
@tar_writer.mkdir 'x', 0
|
104
104
|
end
|
105
105
|
assert_equal 'closed Gem::Package::TarWriter', e.message
|
@@ -125,7 +125,7 @@ class TestTarWriter < TarTestCase
|
|
125
125
|
name = File.join 'a', 'b' * 100
|
126
126
|
assert_equal ['b' * 100, 'a'], @tar_writer.split_name(name)
|
127
127
|
|
128
|
-
|
128
|
+
assert_raises Gem::Package::TooLongFileName do
|
129
129
|
name = File.join 'a', 'b' * 101
|
130
130
|
@tar_writer.split_name name
|
131
131
|
end
|
@@ -135,14 +135,14 @@ class TestTarWriter < TarTestCase
|
|
135
135
|
name = File.join 'a' * 155, 'b'
|
136
136
|
assert_equal ['b', 'a' * 155], @tar_writer.split_name(name)
|
137
137
|
|
138
|
-
|
138
|
+
assert_raises Gem::Package::TooLongFileName do
|
139
139
|
name = File.join 'a' * 156, 'b'
|
140
140
|
@tar_writer.split_name name
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
144
|
def test_split_name_too_long_total
|
145
|
-
|
145
|
+
assert_raises Gem::Package::TooLongFileName do
|
146
146
|
@tar_writer.split_name 'a' * 257
|
147
147
|
end
|
148
148
|
end
|
data/test/test_gem_platform.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
2
|
-
require 'test/unit'
|
3
2
|
require 'rubygems/platform'
|
4
3
|
require 'rbconfig'
|
5
4
|
|
@@ -147,8 +146,8 @@ class TestGemPlatform < RubyGemTestCase
|
|
147
146
|
other = Gem::Platform.new %w[cpu other_platform 1]
|
148
147
|
|
149
148
|
assert_equal my, my
|
150
|
-
|
151
|
-
|
149
|
+
refute_equal my, other
|
150
|
+
refute_equal other, my
|
152
151
|
end
|
153
152
|
|
154
153
|
def test_equals3
|
@@ -205,10 +204,10 @@ class TestGemPlatform < RubyGemTestCase
|
|
205
204
|
# oddballs
|
206
205
|
assert_match 'i386-mswin32-mq5.3', Gem::Platform.local
|
207
206
|
assert_match 'i386-mswin32-mq6', Gem::Platform.local
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
207
|
+
refute_match 'win32-1.8.2-VC7', Gem::Platform.local
|
208
|
+
refute_match 'win32-1.8.4-VC6', Gem::Platform.local
|
209
|
+
refute_match 'win32-source', Gem::Platform.local
|
210
|
+
refute_match 'windows', Gem::Platform.local
|
212
211
|
|
213
212
|
util_set_arch 'i686-linux'
|
214
213
|
assert_match 'i486-linux', Gem::Platform.local
|
@@ -236,17 +235,5 @@ class TestGemPlatform < RubyGemTestCase
|
|
236
235
|
assert_match 'sparc-solaris2.8-mq5.3', Gem::Platform.local
|
237
236
|
end
|
238
237
|
|
239
|
-
def assert_match(pattern, platform, message = '')
|
240
|
-
full_message = build_message message, "<?> expected to be =~\n<?>.",
|
241
|
-
platform, pattern
|
242
|
-
assert_block(full_message) { platform =~ pattern }
|
243
|
-
end
|
244
|
-
|
245
|
-
def deny_match(pattern, platform, message = '')
|
246
|
-
full_message = build_message message, "<?> expected to be !~\n<?>.",
|
247
|
-
platform, pattern
|
248
|
-
assert_block(full_message) { platform !~ pattern }
|
249
|
-
end
|
250
|
-
|
251
238
|
end
|
252
239
|
|
@@ -1,11 +1,9 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
#--
|
3
2
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
3
|
# All rights reserved.
|
5
4
|
# See LICENSE.txt for permissions.
|
6
5
|
#++
|
7
6
|
|
8
|
-
require 'test/unit'
|
9
7
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
10
8
|
require 'webrick'
|
11
9
|
require 'zlib'
|
@@ -111,9 +109,14 @@ gems:
|
|
111
109
|
@fetcher = Gem::RemoteFetcher.fetcher
|
112
110
|
end
|
113
111
|
|
112
|
+
def teardown
|
113
|
+
super
|
114
|
+
Gem.configuration[:http_proxy] = nil
|
115
|
+
end
|
116
|
+
|
114
117
|
def test_self_fetcher
|
115
118
|
fetcher = Gem::RemoteFetcher.fetcher
|
116
|
-
|
119
|
+
refute_nil fetcher
|
117
120
|
assert_kind_of Gem::RemoteFetcher, fetcher
|
118
121
|
end
|
119
122
|
|
@@ -124,7 +127,7 @@ gems:
|
|
124
127
|
|
125
128
|
fetcher = Gem::RemoteFetcher.fetcher
|
126
129
|
|
127
|
-
|
130
|
+
refute_nil fetcher
|
128
131
|
assert_kind_of Gem::RemoteFetcher, fetcher
|
129
132
|
assert_equal proxy_uri, fetcher.instance_variable_get(:@proxy_uri).to_s
|
130
133
|
end
|
@@ -132,8 +135,11 @@ gems:
|
|
132
135
|
def test_self_fetcher_with_proxy_URI
|
133
136
|
proxy_uri = URI.parse 'http://proxy.example.com'
|
134
137
|
Gem.configuration[:http_proxy] = proxy_uri
|
138
|
+
Gem::RemoteFetcher.fetcher = nil
|
139
|
+
|
135
140
|
fetcher = Gem::RemoteFetcher.fetcher
|
136
|
-
|
141
|
+
refute_nil fetcher
|
142
|
+
|
137
143
|
assert_kind_of Gem::RemoteFetcher, fetcher
|
138
144
|
assert_equal proxy_uri, fetcher.instance_variable_get(:@proxy_uri)
|
139
145
|
end
|
@@ -141,7 +147,7 @@ gems:
|
|
141
147
|
def test_fetch_size_bad_uri
|
142
148
|
fetcher = Gem::RemoteFetcher.new nil
|
143
149
|
|
144
|
-
e =
|
150
|
+
e = assert_raises ArgumentError do
|
145
151
|
fetcher.fetch_size 'gems.example.com/yaml'
|
146
152
|
end
|
147
153
|
|
@@ -155,7 +161,7 @@ gems:
|
|
155
161
|
end
|
156
162
|
|
157
163
|
uri = 'http://gems.example.com/yaml'
|
158
|
-
e =
|
164
|
+
e = assert_raises Gem::RemoteFetcher::FetchError do
|
159
165
|
fetcher.fetch_size uri
|
160
166
|
end
|
161
167
|
|
@@ -310,7 +316,7 @@ gems:
|
|
310
316
|
def test_download_unsupported
|
311
317
|
inst = Gem::RemoteFetcher.fetcher
|
312
318
|
|
313
|
-
e =
|
319
|
+
e = assert_raises Gem::InstallError do
|
314
320
|
inst.download @a1, 'ftp://gems.rubyforge.org'
|
315
321
|
end
|
316
322
|
|
@@ -408,7 +414,7 @@ gems:
|
|
408
414
|
raise EOFError
|
409
415
|
end
|
410
416
|
|
411
|
-
e =
|
417
|
+
e = assert_raises Gem::RemoteFetcher::FetchError do
|
412
418
|
fetcher.fetch_path 'uri'
|
413
419
|
end
|
414
420
|
|
@@ -423,7 +429,7 @@ gems:
|
|
423
429
|
raise SocketError
|
424
430
|
end
|
425
431
|
|
426
|
-
e =
|
432
|
+
e = assert_raises Gem::RemoteFetcher::FetchError do
|
427
433
|
fetcher.fetch_path 'uri'
|
428
434
|
end
|
429
435
|
|
@@ -438,7 +444,7 @@ gems:
|
|
438
444
|
raise Errno::ECONNREFUSED, 'connect(2)'
|
439
445
|
end
|
440
446
|
|
441
|
-
e =
|
447
|
+
e = assert_raises Gem::RemoteFetcher::FetchError do
|
442
448
|
fetcher.fetch_path 'uri'
|
443
449
|
end
|
444
450
|
|
@@ -546,7 +552,7 @@ gems:
|
|
546
552
|
conn = { 'gems.example.com:80' => conn }
|
547
553
|
fetcher.instance_variable_set :@connections, conn
|
548
554
|
|
549
|
-
e =
|
555
|
+
e = assert_raises Gem::RemoteFetcher::FetchError do
|
550
556
|
fetcher.open_uri_or_path 'http://gems.example.com/redirect'
|
551
557
|
end
|
552
558
|
|
@@ -4,7 +4,6 @@
|
|
4
4
|
# See LICENSE.txt for permissions.
|
5
5
|
#++
|
6
6
|
|
7
|
-
require 'test/unit'
|
8
7
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
9
8
|
require 'rubygems/version'
|
10
9
|
|
@@ -32,19 +31,19 @@ class TestGemRequirement < RubyGemTestCase
|
|
32
31
|
assert_equal @r1_2, @r1_2.dup
|
33
32
|
assert_equal @r1_2.dup, @r1_2
|
34
33
|
|
35
|
-
|
36
|
-
|
34
|
+
refute_equal @r1_3, @r1_2
|
35
|
+
refute_equal @r1_2, @r1_3
|
37
36
|
|
38
|
-
|
39
|
-
|
37
|
+
refute_equal Object.new, @r1_2
|
38
|
+
refute_equal @r1_2, Object.new
|
40
39
|
end
|
41
40
|
|
42
41
|
def test_hash
|
43
42
|
assert_equal @r1_2.hash, @r1_2.dup.hash
|
44
43
|
assert_equal @r1_2.dup.hash, @r1_2.hash
|
45
44
|
|
46
|
-
|
47
|
-
|
45
|
+
refute_equal @r1_2.hash, @r1_3.hash
|
46
|
+
refute_equal @r1_3.hash, @r1_2.hash
|
48
47
|
end
|
49
48
|
|
50
49
|
# We may get some old gems that have requirements in old formats.
|
@@ -80,13 +79,13 @@ class TestGemRequirement < RubyGemTestCase
|
|
80
79
|
end
|
81
80
|
|
82
81
|
def test_parse_illformed
|
83
|
-
e =
|
82
|
+
e = assert_raises ArgumentError do
|
84
83
|
@r1_2.parse(nil)
|
85
84
|
end
|
86
85
|
|
87
86
|
assert_equal 'Illformed requirement [nil]', e.message
|
88
87
|
|
89
|
-
e =
|
88
|
+
e = assert_raises ArgumentError do
|
90
89
|
@r1_2.parse('')
|
91
90
|
end
|
92
91
|
|
@@ -139,7 +138,7 @@ class TestGemRequirement < RubyGemTestCase
|
|
139
138
|
assert_equal false, r1_2.satisfied_by?(v1_2)
|
140
139
|
assert_equal true, r1_2.satisfied_by?(v1_3)
|
141
140
|
|
142
|
-
|
141
|
+
assert_raises NoMethodError do
|
143
142
|
assert_equal true, r1_2.satisfied_by?(nil)
|
144
143
|
end
|
145
144
|
end
|
@@ -154,7 +153,7 @@ class TestGemRequirement < RubyGemTestCase
|
|
154
153
|
assert_equal true, r1_2.satisfied_by?(v1_2)
|
155
154
|
assert_equal true, r1_2.satisfied_by?(v1_3)
|
156
155
|
|
157
|
-
|
156
|
+
assert_raises NoMethodError do
|
158
157
|
assert_equal true, r1_2.satisfied_by?(nil)
|
159
158
|
end
|
160
159
|
end
|
@@ -169,7 +168,7 @@ class TestGemRequirement < RubyGemTestCase
|
|
169
168
|
assert_equal true, r.satisfied_by?(v1_2)
|
170
169
|
assert_equal false, r.satisfied_by?(v1_3)
|
171
170
|
|
172
|
-
|
171
|
+
assert_raises NoMethodError do
|
173
172
|
assert_equal true, r.satisfied_by?(nil)
|
174
173
|
end
|
175
174
|
end
|
@@ -184,7 +183,7 @@ class TestGemRequirement < RubyGemTestCase
|
|
184
183
|
assert_equal false, r1_2.satisfied_by?(v1_2)
|
185
184
|
assert_equal false, r1_2.satisfied_by?(v1_3)
|
186
185
|
|
187
|
-
|
186
|
+
assert_raises NoMethodError do
|
188
187
|
assert_equal true, r1_2.satisfied_by?(nil)
|
189
188
|
end
|
190
189
|
end
|
@@ -199,7 +198,7 @@ class TestGemRequirement < RubyGemTestCase
|
|
199
198
|
assert_equal true, r1_2.satisfied_by?(v1_2)
|
200
199
|
assert_equal false, r1_2.satisfied_by?(v1_3)
|
201
200
|
|
202
|
-
|
201
|
+
assert_raises NoMethodError do
|
203
202
|
assert_equal true, r1_2.satisfied_by?(nil)
|
204
203
|
end
|
205
204
|
end
|
@@ -214,7 +213,7 @@ class TestGemRequirement < RubyGemTestCase
|
|
214
213
|
assert_equal true, r1_2.satisfied_by?(v1_2)
|
215
214
|
assert_equal true, r1_2.satisfied_by?(v1_3)
|
216
215
|
|
217
|
-
|
216
|
+
assert_raises NoMethodError do
|
218
217
|
assert_equal true, r1_2.satisfied_by?(nil)
|
219
218
|
end
|
220
219
|
end
|
data/test/test_gem_server.rb
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
# See LICENSE.txt for permissions.
|
5
5
|
#++
|
6
6
|
|
7
|
-
require 'test/unit'
|
8
7
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
9
8
|
require 'rubygems/source_index'
|
10
9
|
require 'rubygems/config_file'
|
@@ -150,7 +149,7 @@ WARNING: Invalid .gemspec format in '#{spec_file}'
|
|
150
149
|
end
|
151
150
|
|
152
151
|
use_ui @ui do
|
153
|
-
|
152
|
+
assert_raises Interrupt do
|
154
153
|
Gem::SourceIndex.load_specification(spec_file)
|
155
154
|
end
|
156
155
|
end
|
@@ -192,7 +191,7 @@ WARNING: Invalid .gemspec format in '#{spec_file}'
|
|
192
191
|
end
|
193
192
|
|
194
193
|
use_ui @ui do
|
195
|
-
|
194
|
+
assert_raises SystemExit do
|
196
195
|
Gem::SourceIndex.load_specification(spec_file)
|
197
196
|
end
|
198
197
|
end
|
@@ -232,7 +231,7 @@ WARNING: Invalid .gemspec format in '#{spec_file}'
|
|
232
231
|
@fetcher.data["#{@gem_repo}yaml.Z"] = proc { raise SocketError }
|
233
232
|
@fetcher.data["#{@gem_repo}yaml"] = proc { raise SocketError }
|
234
233
|
|
235
|
-
e =
|
234
|
+
e = assert_raises Gem::RemoteSourceException do
|
236
235
|
use_ui @ui do
|
237
236
|
@source_index.fetch_bulk_index @uri
|
238
237
|
end
|
@@ -357,7 +356,7 @@ WARNING: Invalid .gemspec format in '#{spec_file}'
|
|
357
356
|
@fetcher.data["#{@gem_repo}quick/index.rz"] =
|
358
357
|
proc { raise Exception }
|
359
358
|
|
360
|
-
e =
|
359
|
+
e = assert_raises Gem::OperationNotSupportedError do
|
361
360
|
@source_index.fetch_quick_index @uri, true
|
362
361
|
end
|
363
362
|
|
@@ -613,7 +612,7 @@ WARNING: Invalid .gemspec format in '#{spec_file}'
|
|
613
612
|
def test_refresh_bang_not_from_dir
|
614
613
|
source_index = Gem::SourceIndex.new
|
615
614
|
|
616
|
-
e =
|
615
|
+
e = assert_raises RuntimeError do
|
617
616
|
source_index.refresh!
|
618
617
|
end
|
619
618
|
|
@@ -1,11 +1,9 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
#--
|
3
2
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
3
|
# All rights reserved.
|
5
4
|
# See LICENSE.txt for permissions.
|
6
5
|
#++
|
7
6
|
|
8
|
-
require 'test/unit'
|
9
7
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
10
8
|
require 'rubygems/source_info_cache'
|
11
9
|
|
@@ -49,7 +47,7 @@ class TestGemSourceInfoCache < RubyGemTestCase
|
|
49
47
|
Gem.sources.replace %W[#{@gem_repo}]
|
50
48
|
|
51
49
|
use_ui @ui do
|
52
|
-
|
50
|
+
refute_nil Gem::SourceInfoCache.cache
|
53
51
|
assert_kind_of Gem::SourceInfoCache, Gem::SourceInfoCache.cache
|
54
52
|
assert_equal Gem::SourceInfoCache.cache.object_id,
|
55
53
|
Gem::SourceInfoCache.cache.object_id
|
@@ -68,11 +66,11 @@ class TestGemSourceInfoCache < RubyGemTestCase
|
|
68
66
|
Gem.sources.replace %w[#{@gem_repo}]
|
69
67
|
|
70
68
|
use_ui @ui do
|
71
|
-
|
69
|
+
refute_nil Gem::SourceInfoCache.cache
|
72
70
|
assert_kind_of Gem::SourceInfoCache, Gem::SourceInfoCache.cache
|
73
71
|
assert_equal Gem::SourceInfoCache.cache.object_id,
|
74
72
|
Gem::SourceInfoCache.cache.object_id
|
75
|
-
|
73
|
+
refute_match %r|Bulk updating|, @ui.output
|
76
74
|
end
|
77
75
|
end
|
78
76
|
|
@@ -147,7 +145,7 @@ class TestGemSourceInfoCache < RubyGemTestCase
|
|
147
145
|
def test_cache_data_none_writable
|
148
146
|
FileUtils.chmod 0444, @sic.system_cache_file
|
149
147
|
FileUtils.chmod 0444, @sic.user_cache_file
|
150
|
-
e =
|
148
|
+
e = assert_raises RuntimeError do
|
151
149
|
@sic.cache_data
|
152
150
|
end
|
153
151
|
assert_equal 'unable to locate a writable cache file', e.message
|
@@ -202,7 +200,7 @@ class TestGemSourceInfoCache < RubyGemTestCase
|
|
202
200
|
def test_cache_file_none_writable
|
203
201
|
FileUtils.chmod 0444, @sic.system_cache_file
|
204
202
|
FileUtils.chmod 0444, @sic.user_cache_file
|
205
|
-
e =
|
203
|
+
e = assert_raises RuntimeError do
|
206
204
|
@sic.cache_file
|
207
205
|
end
|
208
206
|
assert_equal 'unable to locate a writable cache file', e.message
|