rubygems-update 1.3.1 → 1.3.2
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.tar.gz.sig +0 -0
- data/.autotest +24 -0
- data/.document +4 -3
- data/ChangeLog +382 -1
- data/Manifest.txt +214 -0
- data/README +1 -49
- data/Rakefile +124 -191
- data/bin/gem +1 -4
- data/cruise_config.rb +22 -0
- data/doc/release_notes/rel_1_3_1.rdoc +3 -3
- data/doc/release_notes/rel_1_3_2.rdoc +119 -0
- data/lib/gauntlet_rubygems.rb +50 -0
- data/lib/rubygems.rb +250 -25
- data/lib/rubygems/builder.rb +62 -60
- data/lib/rubygems/command.rb +421 -319
- data/lib/rubygems/command_manager.rb +153 -125
- data/lib/rubygems/commands/check_command.rb +12 -7
- data/lib/rubygems/commands/cleanup_command.rb +11 -2
- data/lib/rubygems/commands/contents_command.rb +42 -18
- data/lib/rubygems/commands/generate_index_command.rb +91 -15
- data/lib/rubygems/commands/install_command.rb +33 -47
- data/lib/rubygems/commands/query_command.rb +36 -20
- data/lib/rubygems/commands/rdoc_command.rb +62 -68
- data/lib/rubygems/commands/search_command.rb +26 -32
- data/lib/rubygems/commands/setup_command.rb +353 -0
- data/lib/rubygems/commands/sources_command.rb +5 -0
- data/lib/rubygems/commands/specification_command.rb +23 -3
- data/lib/rubygems/commands/uninstall_command.rb +71 -61
- data/lib/rubygems/commands/unpack_command.rb +14 -12
- data/lib/rubygems/commands/update_command.rb +26 -5
- data/lib/rubygems/defaults.rb +16 -3
- data/lib/rubygems/dependency.rb +38 -7
- data/lib/rubygems/dependency_installer.rb +7 -4
- data/lib/rubygems/digest/digest_adapter.rb +42 -33
- data/lib/rubygems/digest/sha1.rb +6 -1
- data/lib/rubygems/digest/sha2.rb +5 -0
- data/lib/rubygems/doc_manager.rb +31 -11
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -1
- data/lib/rubygems/ext/rake_builder.rb +6 -2
- data/lib/rubygems/format.rb +63 -63
- data/lib/rubygems/gem_openssl.rb +14 -2
- data/lib/rubygems/gem_path_searcher.rb +7 -3
- data/lib/rubygems/gem_runner.rb +59 -39
- data/lib/rubygems/indexer.rb +450 -109
- data/lib/rubygems/install_update_options.rb +13 -1
- data/lib/rubygems/installer.rb +25 -22
- data/lib/rubygems/local_remote_options.rb +5 -3
- data/lib/rubygems/old_format.rb +124 -120
- data/lib/rubygems/package/tar_header.rb +25 -3
- data/lib/rubygems/package/tar_input.rb +5 -5
- data/lib/rubygems/package/tar_output.rb +2 -0
- data/lib/rubygems/package/tar_reader.rb +19 -0
- data/lib/rubygems/package/tar_reader/entry.rb +43 -0
- data/lib/rubygems/package/tar_writer.rb +65 -3
- data/lib/rubygems/package_task.rb +117 -0
- data/lib/rubygems/platform.rb +12 -8
- data/lib/rubygems/remote_fetcher.rb +43 -24
- data/lib/rubygems/require_paths_builder.rb +14 -12
- data/lib/rubygems/requirement.rb +15 -6
- data/lib/rubygems/rubygems_version.rb +14 -1
- data/lib/rubygems/source_index.rb +38 -16
- data/lib/rubygems/source_info_cache_entry.rb +2 -2
- data/lib/rubygems/spec_fetcher.rb +43 -20
- data/lib/rubygems/specification.rb +1122 -947
- data/lib/rubygems/text.rb +30 -0
- data/lib/rubygems/timer.rb +14 -11
- data/lib/rubygems/uninstaller.rb +25 -5
- data/lib/rubygems/user_interaction.rb +294 -264
- data/lib/rubygems/validator.rb +70 -36
- data/lib/rubygems/version.rb +97 -33
- data/lib/rubygems/version_option.rb +1 -0
- data/setup.rb +11 -306
- data/test/foo/discover.rb +0 -0
- data/test/gem_installer_test_case.rb +22 -11
- data/test/gem_package_tar_test_case.rb +0 -14
- data/test/gemutilities.rb +89 -8
- data/test/mockgemui.rb +2 -1
- data/test/rubygems_plugin.rb +16 -0
- data/test/test_gem.rb +107 -36
- data/test/test_gem_command.rb +3 -13
- data/test/test_gem_command_manager.rb +1 -14
- data/test/test_gem_commands_cert_command.rb +1 -1
- data/test/test_gem_commands_contents_command.rb +63 -0
- data/test/test_gem_commands_environment_command.rb +1 -1
- data/test/test_gem_commands_generate_index_command.rb +104 -1
- data/test/test_gem_commands_install_command.rb +95 -0
- data/test/test_gem_commands_pristine_command.rb +3 -3
- data/test/test_gem_commands_query_command.rb +46 -0
- data/test/test_gem_commands_sources_command.rb +9 -5
- data/test/test_gem_commands_specification_command.rb +31 -0
- data/test/test_gem_commands_uninstall_command.rb +3 -2
- data/test/test_gem_commands_unpack_command.rb +3 -2
- data/test/test_gem_commands_update_command.rb +12 -7
- data/test/test_gem_dependency.rb +62 -11
- data/test/test_gem_dependency_installer.rb +18 -5
- data/test/test_gem_dependency_list.rb +6 -6
- data/test/test_gem_doc_manager.rb +7 -1
- data/test/test_gem_ext_configure_builder.rb +8 -10
- data/test/test_gem_ext_ext_conf_builder.rb +14 -8
- data/test/test_gem_gem_path_searcher.rb +1 -1
- data/test/test_gem_gem_runner.rb +11 -0
- data/test/test_gem_indexer.rb +398 -21
- data/test/test_gem_install_update_options.rb +20 -6
- data/test/test_gem_installer.rb +22 -14
- data/test/test_gem_local_remote_options.rb +2 -1
- data/test/test_gem_package_tar_header.rb +3 -3
- data/test/test_gem_package_tar_input.rb +3 -3
- data/test/test_gem_package_tar_output.rb +2 -2
- data/test/test_gem_package_task.rb +70 -0
- data/test/test_gem_platform.rb +12 -6
- data/test/test_gem_remote_fetcher.rb +23 -1
- data/test/test_gem_source_index.rb +32 -21
- data/test/test_gem_spec_fetcher.rb +77 -5
- data/test/test_gem_specification.rb +274 -1
- data/test/test_gem_uninstaller.rb +34 -4
- data/test/test_gem_version.rb +94 -4
- data/test/test_gem_version_option.rb +13 -0
- data/test/test_kernel.rb +4 -4
- data/util/CL2notes +56 -0
- data/util/gem_prelude.rb.template +251 -0
- metadata +30 -20
- metadata.gz.sig +3 -4
- data/TODO +0 -1
- data/scripts/buildtests.rb +0 -31
- data/scripts/gemdoc.rb +0 -67
- data/scripts/runtest.rb +0 -40
- data/scripts/specdoc.rb +0 -171
- data/scripts/upload_gemdoc.rb +0 -140
@@ -11,6 +11,10 @@ class TestGemCommandsSourcesCommand < RubyGemTestCase
|
|
11
11
|
@new_repo = "http://beta-gems.example.com"
|
12
12
|
end
|
13
13
|
|
14
|
+
def test_initialize_proxy
|
15
|
+
assert @cmd.handles?(['--http-proxy', 'http://proxy.example.com'])
|
16
|
+
end
|
17
|
+
|
14
18
|
def test_execute
|
15
19
|
util_setup_spec_fetcher
|
16
20
|
@cmd.handle_options []
|
@@ -175,12 +179,12 @@ Will cause RubyGems to revert to legacy indexes, degrading performance.
|
|
175
179
|
assert_equal expected, @ui.output
|
176
180
|
assert_equal '', @ui.error
|
177
181
|
|
178
|
-
|
182
|
+
refute File.exist?(cache.system_cache_file),
|
179
183
|
'system cache file'
|
180
|
-
|
184
|
+
refute File.exist?(cache.latest_system_cache_file),
|
181
185
|
'latest system cache file'
|
182
186
|
|
183
|
-
|
187
|
+
refute File.exist?(fetcher.dir), 'cache dir removed'
|
184
188
|
end
|
185
189
|
|
186
190
|
def test_execute_remove
|
@@ -244,7 +248,7 @@ Will cause RubyGems to revert to legacy indexes, degrading performance.
|
|
244
248
|
assert_equal "source cache successfully updated\n", @ui.output
|
245
249
|
assert_equal '', @ui.error
|
246
250
|
end
|
247
|
-
|
251
|
+
|
248
252
|
def test_execute_update_legacy
|
249
253
|
@cmd.handle_options %w[--update]
|
250
254
|
|
@@ -269,6 +273,6 @@ source cache successfully updated
|
|
269
273
|
assert_equal expected, @ui.output
|
270
274
|
assert_equal '', @ui.error
|
271
275
|
end
|
272
|
-
|
276
|
+
|
273
277
|
end
|
274
278
|
|
@@ -70,6 +70,21 @@ class TestGemCommandsSpecificationCommand < RubyGemTestCase
|
|
70
70
|
assert_equal '', @ui.error
|
71
71
|
end
|
72
72
|
|
73
|
+
def test_execute_marshal
|
74
|
+
foo = quick_gem 'foo'
|
75
|
+
Gem.source_index.add_spec foo
|
76
|
+
|
77
|
+
@cmd.options[:args] = %w[foo]
|
78
|
+
@cmd.options[:format] = :marshal
|
79
|
+
|
80
|
+
use_ui @ui do
|
81
|
+
@cmd.execute
|
82
|
+
end
|
83
|
+
|
84
|
+
assert_equal foo, Marshal.load(@ui.output)
|
85
|
+
assert_equal '', @ui.error
|
86
|
+
end
|
87
|
+
|
73
88
|
def test_execute_remote
|
74
89
|
foo = quick_gem 'foo'
|
75
90
|
|
@@ -92,5 +107,21 @@ class TestGemCommandsSpecificationCommand < RubyGemTestCase
|
|
92
107
|
assert_match %r|name: foo|, @ui.output
|
93
108
|
end
|
94
109
|
|
110
|
+
def test_execute_ruby
|
111
|
+
foo = quick_gem 'foo'
|
112
|
+
Gem.source_index.add_spec foo
|
113
|
+
|
114
|
+
@cmd.options[:args] = %w[foo]
|
115
|
+
@cmd.options[:format] = :ruby
|
116
|
+
|
117
|
+
use_ui @ui do
|
118
|
+
@cmd.execute
|
119
|
+
end
|
120
|
+
|
121
|
+
assert_match %r|Gem::Specification.new|, @ui.output
|
122
|
+
assert_match %r|s.name = %q\{foo\}|, @ui.output
|
123
|
+
assert_equal '', @ui.error
|
124
|
+
end
|
125
|
+
|
95
126
|
end
|
96
127
|
|
@@ -53,9 +53,10 @@ class TestGemCommandsUninstallCommand < GemInstallerTestCase
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
assert_match(/\
|
56
|
+
assert_match(/\Acannot uninstall, check `gem list -d foo`$/, e.message)
|
57
57
|
output = @ui.output.split "\n"
|
58
|
-
|
58
|
+
assert_empty output, "UI output should be empty after an uninstall error"
|
59
59
|
end
|
60
|
+
|
60
61
|
end
|
61
62
|
|
@@ -14,7 +14,7 @@ class TestGemCommandsUnpackCommand < RubyGemTestCase
|
|
14
14
|
def test_execute
|
15
15
|
util_make_gems
|
16
16
|
|
17
|
-
@cmd.options[:args] = %w[a]
|
17
|
+
@cmd.options[:args] = %w[a b]
|
18
18
|
|
19
19
|
use_ui @ui do
|
20
20
|
Dir.chdir @tempdir do
|
@@ -22,7 +22,8 @@ class TestGemCommandsUnpackCommand < RubyGemTestCase
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
assert File.exist?(File.join(@tempdir, 'a-2'))
|
25
|
+
assert File.exist?(File.join(@tempdir, 'a-2')), 'a should be installed'
|
26
|
+
assert File.exist?(File.join(@tempdir, 'b-2')), 'b should be installed'
|
26
27
|
end
|
27
28
|
|
28
29
|
def test_execute_gem_path
|
@@ -8,6 +8,9 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
8
8
|
|
9
9
|
@cmd = Gem::Commands::UpdateCommand.new
|
10
10
|
|
11
|
+
@cmd.options[:generate_rdoc] = false
|
12
|
+
@cmd.options[:generate_ri] = false
|
13
|
+
|
11
14
|
util_setup_fake_fetcher
|
12
15
|
|
13
16
|
@a1_path = File.join @gemhome, 'cache', "#{@a1.full_name}.gem"
|
@@ -27,6 +30,8 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
27
30
|
Gem::Installer.new(@a1_path).install
|
28
31
|
|
29
32
|
@cmd.options[:args] = []
|
33
|
+
@cmd.options[:generate_rdoc] = true
|
34
|
+
@cmd.options[:generate_ri] = true
|
30
35
|
|
31
36
|
use_ui @ui do
|
32
37
|
@cmd.execute
|
@@ -37,8 +42,10 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
37
42
|
assert_equal "Updating #{@a2.name}", out.shift
|
38
43
|
assert_equal "Successfully installed #{@a2.full_name}", out.shift
|
39
44
|
assert_equal "Gems updated: #{@a2.name}", out.shift
|
45
|
+
assert_equal "Installing ri documentation for a-2...", out.shift
|
46
|
+
assert_equal "Installing RDoc documentation for a-2...", out.shift
|
40
47
|
|
41
|
-
|
48
|
+
assert_empty out
|
42
49
|
end
|
43
50
|
|
44
51
|
# before:
|
@@ -101,7 +108,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
101
108
|
assert_equal "Gems updated: #{@c2.name}, #{@b2.name}, #{@a2.name}",
|
102
109
|
out.shift
|
103
110
|
|
104
|
-
|
111
|
+
assert_empty out
|
105
112
|
end
|
106
113
|
|
107
114
|
def test_execute_named
|
@@ -121,7 +128,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
121
128
|
assert_equal "Successfully installed #{@a2.full_name}", out.shift
|
122
129
|
assert_equal "Gems updated: #{@a2.name}", out.shift
|
123
130
|
|
124
|
-
|
131
|
+
assert_empty out
|
125
132
|
end
|
126
133
|
|
127
134
|
def test_execute_named_up_to_date
|
@@ -139,7 +146,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
139
146
|
assert_equal "Updating installed gems", out.shift
|
140
147
|
assert_equal "Nothing to update", out.shift
|
141
148
|
|
142
|
-
|
149
|
+
assert_empty out
|
143
150
|
end
|
144
151
|
|
145
152
|
def test_execute_up_to_date
|
@@ -157,8 +164,6 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase
|
|
157
164
|
assert_equal "Updating installed gems", out.shift
|
158
165
|
assert_equal "Nothing to update", out.shift
|
159
166
|
|
160
|
-
|
167
|
+
assert_empty out
|
161
168
|
end
|
162
|
-
|
163
169
|
end
|
164
|
-
|
data/test/test_gem_dependency.rb
CHANGED
@@ -20,6 +20,10 @@ class TestGemDependency < RubyGemTestCase
|
|
20
20
|
@r1_0 = Gem::Requirement.new ['> 1.0']
|
21
21
|
end
|
22
22
|
|
23
|
+
def dep(name, version)
|
24
|
+
Gem::Dependency.new name, version
|
25
|
+
end
|
26
|
+
|
23
27
|
def test_initialize
|
24
28
|
assert_equal "pkg", @pkg1_0.name
|
25
29
|
assert_equal @r1_0, @pkg1_0.version_requirements
|
@@ -96,10 +100,6 @@ class TestGemDependency < RubyGemTestCase
|
|
96
100
|
end
|
97
101
|
|
98
102
|
def test_equals_tilde
|
99
|
-
def dep(name, version)
|
100
|
-
Gem::Dependency.new name, version
|
101
|
-
end
|
102
|
-
|
103
103
|
a0 = dep 'a', '0'
|
104
104
|
a1 = dep 'a', '1'
|
105
105
|
b0 = dep 'b', '0'
|
@@ -108,14 +108,64 @@ class TestGemDependency < RubyGemTestCase
|
|
108
108
|
pa0r = dep(/a/, '>= 0')
|
109
109
|
pab0r = dep(/a|b/, '>= 0')
|
110
110
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
111
|
+
assert_match a0, a0, 'match self'
|
112
|
+
assert_match pa0, a0, 'match version exact'
|
113
|
+
assert_match pa0, a1, 'match version'
|
114
|
+
assert_match pa0r, a0, 'match regex simple'
|
115
|
+
assert_match pab0r, a0, 'match regex complex'
|
116
|
+
|
117
|
+
refute_match pa0r, b0, 'fail match regex'
|
118
|
+
refute_match pa0r, Object.new, 'fail match Object'
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_equals_tilde_escape
|
122
|
+
a1 = Gem::Dependency.new 'a', '1'
|
123
|
+
|
124
|
+
pab1 = Gem::Dependency.new 'a|b', '>= 1'
|
125
|
+
pab1r = Gem::Dependency.new(/a|b/, '>= 1')
|
126
|
+
|
127
|
+
refute_match pab1, a1, 'escaped'
|
128
|
+
assert_match pab1r, a1, 'exact regexp'
|
129
|
+
end
|
130
|
+
|
131
|
+
def test_equals_tilde_object
|
132
|
+
a0 = Object.new
|
133
|
+
|
134
|
+
def a0.name() 'a' end
|
135
|
+
def a0.version() '0' end
|
136
|
+
|
137
|
+
pa0 = Gem::Dependency.new 'a', '>= 0'
|
138
|
+
|
139
|
+
assert_match pa0, a0, 'match version exact'
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_equals_tilde_spec
|
143
|
+
def spec(name, version)
|
144
|
+
Gem::Specification.new do |spec|
|
145
|
+
spec.name = name
|
146
|
+
spec.version = version
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
a0 = spec 'a', '0'
|
151
|
+
a1 = spec 'a', '1'
|
152
|
+
b0 = spec 'b', '0'
|
153
|
+
|
154
|
+
pa0 = dep 'a', '>= 0'
|
155
|
+
pa0r = dep(/a/, '>= 0')
|
156
|
+
pab0r = dep(/a|b/, '>= 0')
|
157
|
+
|
158
|
+
assert_match pa0, a0, 'match version exact'
|
159
|
+
assert_match pa0, a1, 'match version'
|
116
160
|
|
117
|
-
|
118
|
-
|
161
|
+
assert_match pa0r, a0, 'match regex simple'
|
162
|
+
assert_match pa0r, a1, 'match regex simple'
|
163
|
+
|
164
|
+
assert_match pab0r, a0, 'match regex complex'
|
165
|
+
assert_match pab0r, b0, 'match regex complex'
|
166
|
+
|
167
|
+
refute_match pa0r, b0, 'fail match regex'
|
168
|
+
refute_match pa0r, Object.new, 'fail match Object'
|
119
169
|
end
|
120
170
|
|
121
171
|
def test_hash
|
@@ -135,5 +185,6 @@ class TestGemDependency < RubyGemTestCase
|
|
135
185
|
|
136
186
|
refute_equal(runtime.hash, development.hash)
|
137
187
|
end
|
188
|
+
|
138
189
|
end
|
139
190
|
|
@@ -13,8 +13,10 @@ class TestGemDependencyInstaller < RubyGemTestCase
|
|
13
13
|
write_file File.join('gems', 'a-1', 'bin', 'a_bin') do |fp|
|
14
14
|
fp.puts "#!/usr/bin/ruby"
|
15
15
|
end
|
16
|
+
|
16
17
|
@a1, @a1_gem = util_gem 'a', '1' do |s| s.executables << 'a_bin' end
|
17
|
-
@aa1, @aa1_gem = util_gem 'aa', '1'
|
18
|
+
@aa1, @aa1_gem = util_gem 'aa', '1'
|
19
|
+
@a1_pre, @a1_pre_gem = util_gem 'a', '1.a'
|
18
20
|
|
19
21
|
@b1, @b1_gem = util_gem 'b', '1' do |s|
|
20
22
|
s.add_dependency 'a'
|
@@ -44,8 +46,8 @@ class TestGemDependencyInstaller < RubyGemTestCase
|
|
44
46
|
@fetcher = Gem::FakeFetcher.new
|
45
47
|
Gem::RemoteFetcher.fetcher = @fetcher
|
46
48
|
|
47
|
-
si = util_setup_spec_fetcher
|
48
|
-
@y1_1_p, @z1
|
49
|
+
si = util_setup_spec_fetcher(@a1, @a1_pre, @b1, @d1, @d2, @x1_m, @x1_o, @w1, @y1,
|
50
|
+
@y1_1_p, @z1)
|
49
51
|
|
50
52
|
util_clear_gems
|
51
53
|
end
|
@@ -257,7 +259,7 @@ class TestGemDependencyInstaller < RubyGemTestCase
|
|
257
259
|
inst.install 'a'
|
258
260
|
end
|
259
261
|
|
260
|
-
assert_match %r|\A#!/usr/bin/env #{Gem::ConfigMap[:
|
262
|
+
assert_match %r|\A#!/usr/bin/env #{Gem::ConfigMap[:ruby_install_name]}\n|,
|
261
263
|
File.read(File.join(@gemhome, 'bin', 'a_bin'))
|
262
264
|
end
|
263
265
|
|
@@ -632,5 +634,16 @@ class TestGemDependencyInstaller < RubyGemTestCase
|
|
632
634
|
assert_equal %w[d-1 e-1], inst.gems_to_install.map { |s| s.full_name }
|
633
635
|
end
|
634
636
|
|
635
|
-
|
637
|
+
def test_prerelease_uses_pre_index
|
638
|
+
installer = Gem::DependencyInstaller.new
|
639
|
+
pre_installer = Gem::DependencyInstaller.new(:prerelease => true)
|
640
|
+
dependency = Gem::Dependency.new('a', Gem::Requirement.default)
|
641
|
+
|
642
|
+
releases = installer.find_gems_with_sources(dependency).map{ |gems, *| gems }
|
643
|
+
prereleases = pre_installer.find_gems_with_sources(dependency).map{ |gems, *| gems }
|
636
644
|
|
645
|
+
assert releases.select{ |s| s.name == 'a' and s.version.to_s == '1' }.first
|
646
|
+
assert releases.select{ |s| s.name == 'a' and s.version.to_s == '1.a' }.empty?
|
647
|
+
assert_equal [@a1_pre], prereleases
|
648
|
+
end
|
649
|
+
end
|
@@ -105,7 +105,7 @@ class TestGemDependencyList < RubyGemTestCase
|
|
105
105
|
|
106
106
|
@deplist.add @b2
|
107
107
|
|
108
|
-
|
108
|
+
refute @deplist.ok?, 'unsatisfied dependency'
|
109
109
|
|
110
110
|
@deplist.add @a1
|
111
111
|
|
@@ -144,7 +144,7 @@ class TestGemDependencyList < RubyGemTestCase
|
|
144
144
|
|
145
145
|
@deplist.add @b2
|
146
146
|
|
147
|
-
|
147
|
+
refute @deplist.ok_to_remove?("a-1")
|
148
148
|
|
149
149
|
@deplist.add @a2
|
150
150
|
|
@@ -161,7 +161,7 @@ class TestGemDependencyList < RubyGemTestCase
|
|
161
161
|
|
162
162
|
@deplist.remove_by_name("a-1")
|
163
163
|
|
164
|
-
|
164
|
+
refute @deplist.ok_to_remove?("a-2")
|
165
165
|
end
|
166
166
|
|
167
167
|
def test_remove_by_name
|
@@ -169,7 +169,7 @@ class TestGemDependencyList < RubyGemTestCase
|
|
169
169
|
|
170
170
|
@deplist.remove_by_name "a-1"
|
171
171
|
|
172
|
-
|
172
|
+
refute @deplist.ok?
|
173
173
|
end
|
174
174
|
|
175
175
|
def test_tsort_each_node
|
@@ -181,7 +181,7 @@ class TestGemDependencyList < RubyGemTestCase
|
|
181
181
|
assert_equal order.shift, node.full_name
|
182
182
|
end
|
183
183
|
|
184
|
-
|
184
|
+
assert_empty order
|
185
185
|
end
|
186
186
|
|
187
187
|
def test_tsort_each_child
|
@@ -193,7 +193,7 @@ class TestGemDependencyList < RubyGemTestCase
|
|
193
193
|
assert_equal order.shift, node.full_name
|
194
194
|
end
|
195
195
|
|
196
|
-
|
196
|
+
assert_empty order
|
197
197
|
end
|
198
198
|
|
199
199
|
# d1 -> b1 -> a1
|
@@ -18,7 +18,13 @@ class TestGemDocManager < RubyGemTestCase
|
|
18
18
|
|
19
19
|
def test_uninstall_doc_unwritable
|
20
20
|
orig_mode = File.stat(@spec.installation_path).mode
|
21
|
-
|
21
|
+
|
22
|
+
# File.chmod has no effect on MS Windows directories (it needs ACL).
|
23
|
+
if win_platform?
|
24
|
+
skip("test_uninstall_doc_unwritable skipped on MS Windows")
|
25
|
+
else
|
26
|
+
File.chmod(0, @spec.installation_path)
|
27
|
+
end
|
22
28
|
|
23
29
|
assert_raises Gem::FilePermissionError do
|
24
30
|
@manager.uninstall_doc
|
@@ -16,7 +16,7 @@ class TestGemExtConfigureBuilder < RubyGemTestCase
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_self_build
|
19
|
-
|
19
|
+
skip("test_self_build skipped on MS Windows (VC++)") if vc_windows?
|
20
20
|
|
21
21
|
File.open File.join(@ext, './configure'), 'w' do |configure|
|
22
22
|
configure.puts "#!/bin/sh\necho \"#{@makefile_body}\" > Makefile"
|
@@ -37,7 +37,7 @@ class TestGemExtConfigureBuilder < RubyGemTestCase
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_self_build_fail
|
40
|
-
|
40
|
+
skip("test_self_build_fail skipped on MS Windows (VC++)") if vc_windows?
|
41
41
|
output = []
|
42
42
|
|
43
43
|
error = assert_raises Gem::InstallError do
|
@@ -63,6 +63,10 @@ class TestGemExtConfigureBuilder < RubyGemTestCase
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def test_self_build_has_makefile
|
66
|
+
if vc_windows? && !nmake_found?
|
67
|
+
skip("test_self_build_has_makefile skipped - nmake not found")
|
68
|
+
end
|
69
|
+
|
66
70
|
File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
|
67
71
|
makefile.puts @makefile_body
|
68
72
|
end
|
@@ -72,14 +76,8 @@ class TestGemExtConfigureBuilder < RubyGemTestCase
|
|
72
76
|
Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
|
73
77
|
end
|
74
78
|
|
75
|
-
|
76
|
-
|
77
|
-
assert_equal 'nmake', output[0]
|
78
|
-
assert_equal 'nmake install', output[2]
|
79
|
-
else
|
80
|
-
assert_equal 'make', output[0]
|
81
|
-
assert_equal 'make install', output[2]
|
82
|
-
end
|
79
|
+
assert_equal make_command, output[0]
|
80
|
+
assert_equal "#{make_command} install", output[2]
|
83
81
|
end
|
84
82
|
|
85
83
|
end
|
@@ -14,6 +14,10 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_class_build
|
17
|
+
if vc_windows? && !nmake_found?
|
18
|
+
skip("test_class_build skipped - nmake not found")
|
19
|
+
end
|
20
|
+
|
17
21
|
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
|
18
22
|
extconf.puts "require 'mkmf'\ncreate_makefile 'foo'"
|
19
23
|
end
|
@@ -46,6 +50,10 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
|
|
46
50
|
end
|
47
51
|
|
48
52
|
def test_class_build_extconf_fail
|
53
|
+
if vc_windows? && !nmake_found?
|
54
|
+
skip("test_class_build_extconf_fail skipped - nmake not found")
|
55
|
+
end
|
56
|
+
|
49
57
|
File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
|
50
58
|
extconf.puts "require 'mkmf'"
|
51
59
|
extconf.puts "have_library 'nonexistent' or abort 'need libnonexistent'"
|
@@ -69,6 +77,10 @@ checking for main\(\) in .*?nonexistent/m, error.message)
|
|
69
77
|
end
|
70
78
|
|
71
79
|
def test_class_make
|
80
|
+
if vc_windows? && !nmake_found?
|
81
|
+
skip("test_class_make skipped - nmake not found")
|
82
|
+
end
|
83
|
+
|
72
84
|
output = []
|
73
85
|
makefile_path = File.join(@ext, 'Makefile')
|
74
86
|
File.open makefile_path, 'w' do |makefile|
|
@@ -82,14 +94,8 @@ checking for main\(\) in .*?nonexistent/m, error.message)
|
|
82
94
|
Gem::Ext::ExtConfBuilder.make @ext, output
|
83
95
|
end
|
84
96
|
|
85
|
-
|
86
|
-
|
87
|
-
assert_equal 'nmake', output[0]
|
88
|
-
assert_equal 'nmake install', output[2]
|
89
|
-
else
|
90
|
-
assert_equal 'make', output[0]
|
91
|
-
assert_equal 'make install', output[2]
|
92
|
-
end
|
97
|
+
assert_equal make_command, output[0]
|
98
|
+
assert_equal "#{make_command} install", output[2]
|
93
99
|
|
94
100
|
edited_makefile = <<-EOF
|
95
101
|
RUBYARCHDIR = #{@ext}$(target_prefix)
|