rkh-bundler 1.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/.travis.yml +42 -0
- data/CHANGELOG.md +1105 -0
- data/ISSUES.md +67 -0
- data/LICENSE +23 -0
- data/README.md +31 -0
- data/Rakefile +208 -0
- data/UPGRADING.md +103 -0
- data/bin/bundle +31 -0
- data/bundler.gemspec +31 -0
- data/lib/bundler.rb +353 -0
- data/lib/bundler/capistrano.rb +11 -0
- data/lib/bundler/cli.rb +693 -0
- data/lib/bundler/definition.rb +568 -0
- data/lib/bundler/dep_proxy.rb +43 -0
- data/lib/bundler/dependency.rb +134 -0
- data/lib/bundler/deployment.rb +58 -0
- data/lib/bundler/dsl.rb +256 -0
- data/lib/bundler/endpoint_specification.rb +78 -0
- data/lib/bundler/environment.rb +47 -0
- data/lib/bundler/fetcher.rb +225 -0
- data/lib/bundler/gem_helper.rb +162 -0
- data/lib/bundler/gem_helpers.rb +23 -0
- data/lib/bundler/gem_installer.rb +9 -0
- data/lib/bundler/gem_tasks.rb +2 -0
- data/lib/bundler/graph.rb +148 -0
- data/lib/bundler/index.rb +187 -0
- data/lib/bundler/installer.rb +190 -0
- data/lib/bundler/lazy_specification.rb +79 -0
- data/lib/bundler/lockfile_parser.rb +127 -0
- data/lib/bundler/match_platform.rb +13 -0
- data/lib/bundler/psyched_yaml.rb +15 -0
- data/lib/bundler/remote_specification.rb +57 -0
- data/lib/bundler/resolver.rb +486 -0
- data/lib/bundler/ruby_version.rb +94 -0
- data/lib/bundler/rubygems_ext.rb +153 -0
- data/lib/bundler/rubygems_integration.rb +394 -0
- data/lib/bundler/runtime.rb +233 -0
- data/lib/bundler/settings.rb +128 -0
- data/lib/bundler/setup.rb +23 -0
- data/lib/bundler/shared_helpers.rb +71 -0
- data/lib/bundler/source.rb +869 -0
- data/lib/bundler/spec_set.rb +137 -0
- data/lib/bundler/templates/Executable +16 -0
- data/lib/bundler/templates/Executable.standalone +12 -0
- data/lib/bundler/templates/Gemfile +4 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
- data/lib/bundler/templates/newgem/LICENSE.tt +22 -0
- data/lib/bundler/templates/newgem/README.md.tt +29 -0
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/gitignore.tt +17 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -0
- data/lib/bundler/ui.rb +88 -0
- data/lib/bundler/vendor/net/http/faster.rb +27 -0
- data/lib/bundler/vendor/net/http/persistent.rb +468 -0
- data/lib/bundler/vendor/thor.rb +358 -0
- data/lib/bundler/vendor/thor/actions.rb +314 -0
- data/lib/bundler/vendor/thor/actions/create_file.rb +105 -0
- data/lib/bundler/vendor/thor/actions/create_link.rb +57 -0
- data/lib/bundler/vendor/thor/actions/directory.rb +93 -0
- data/lib/bundler/vendor/thor/actions/empty_directory.rb +134 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +270 -0
- data/lib/bundler/vendor/thor/actions/inject_into_file.rb +109 -0
- data/lib/bundler/vendor/thor/base.rb +576 -0
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rb +9 -0
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +75 -0
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rb +100 -0
- data/lib/bundler/vendor/thor/error.rb +30 -0
- data/lib/bundler/vendor/thor/group.rb +273 -0
- data/lib/bundler/vendor/thor/invocation.rb +168 -0
- data/lib/bundler/vendor/thor/parser.rb +4 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +67 -0
- data/lib/bundler/vendor/thor/parser/arguments.rb +161 -0
- data/lib/bundler/vendor/thor/parser/option.rb +120 -0
- data/lib/bundler/vendor/thor/parser/options.rb +172 -0
- data/lib/bundler/vendor/thor/rake_compat.rb +66 -0
- data/lib/bundler/vendor/thor/runner.rb +309 -0
- data/lib/bundler/vendor/thor/shell.rb +88 -0
- data/lib/bundler/vendor/thor/shell/basic.rb +302 -0
- data/lib/bundler/vendor/thor/shell/color.rb +108 -0
- data/lib/bundler/vendor/thor/shell/html.rb +121 -0
- data/lib/bundler/vendor/thor/task.rb +113 -0
- data/lib/bundler/vendor/thor/util.rb +229 -0
- data/lib/bundler/vendor/thor/version.rb +3 -0
- data/lib/bundler/vendored_thor.rb +7 -0
- data/lib/bundler/version.rb +6 -0
- data/lib/bundler/vlad.rb +11 -0
- data/man/bundle-config.ronn +130 -0
- data/man/bundle-exec.ronn +111 -0
- data/man/bundle-install.ronn +335 -0
- data/man/bundle-package.ronn +59 -0
- data/man/bundle-update.ronn +176 -0
- data/man/bundle.ronn +83 -0
- data/man/gemfile.5.ronn +324 -0
- data/man/index.txt +6 -0
- data/spec/bundler/dsl_spec.rb +48 -0
- data/spec/bundler/gem_helper_spec.rb +174 -0
- data/spec/bundler/source_spec.rb +25 -0
- data/spec/cache/gems_spec.rb +239 -0
- data/spec/cache/git_spec.rb +124 -0
- data/spec/cache/path_spec.rb +103 -0
- data/spec/cache/platform_spec.rb +57 -0
- data/spec/install/deploy_spec.rb +211 -0
- data/spec/install/gems/c_ext_spec.rb +48 -0
- data/spec/install/gems/dependency_api_spec.rb +402 -0
- data/spec/install/gems/env_spec.rb +107 -0
- data/spec/install/gems/flex_spec.rb +313 -0
- data/spec/install/gems/groups_spec.rb +268 -0
- data/spec/install/gems/packed_spec.rb +84 -0
- data/spec/install/gems/platform_spec.rb +208 -0
- data/spec/install/gems/post_install_spec.rb +47 -0
- data/spec/install/gems/resolving_spec.rb +72 -0
- data/spec/install/gems/simple_case_spec.rb +814 -0
- data/spec/install/gems/standalone_spec.rb +260 -0
- data/spec/install/gems/sudo_spec.rb +74 -0
- data/spec/install/gems/win32_spec.rb +26 -0
- data/spec/install/gemspec_spec.rb +170 -0
- data/spec/install/git_spec.rb +796 -0
- data/spec/install/invalid_spec.rb +35 -0
- data/spec/install/path_spec.rb +405 -0
- data/spec/install/upgrade_spec.rb +26 -0
- data/spec/lock/git_spec.rb +35 -0
- data/spec/lock/lockfile_spec.rb +809 -0
- data/spec/other/check_spec.rb +265 -0
- data/spec/other/clean_spec.rb +492 -0
- data/spec/other/config_spec.rb +138 -0
- data/spec/other/console_spec.rb +54 -0
- data/spec/other/exec_spec.rb +229 -0
- data/spec/other/ext_spec.rb +37 -0
- data/spec/other/help_spec.rb +39 -0
- data/spec/other/init_spec.rb +40 -0
- data/spec/other/newgem_spec.rb +87 -0
- data/spec/other/open_spec.rb +35 -0
- data/spec/other/outdated_spec.rb +93 -0
- data/spec/other/platform_spec.rb +881 -0
- data/spec/other/show_spec.rb +88 -0
- data/spec/quality_spec.rb +62 -0
- data/spec/realworld/edgecases_spec.rb +177 -0
- data/spec/resolver/basic_spec.rb +20 -0
- data/spec/resolver/platform_spec.rb +82 -0
- data/spec/runtime/executable_spec.rb +120 -0
- data/spec/runtime/load_spec.rb +107 -0
- data/spec/runtime/platform_spec.rb +90 -0
- data/spec/runtime/require_spec.rb +261 -0
- data/spec/runtime/setup_spec.rb +755 -0
- data/spec/runtime/with_clean_env_spec.rb +80 -0
- data/spec/spec_helper.rb +98 -0
- data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +13 -0
- data/spec/support/artifice/endpoint.rb +54 -0
- data/spec/support/artifice/endpoint_500.rb +37 -0
- data/spec/support/artifice/endpoint_api_missing.rb +16 -0
- data/spec/support/artifice/endpoint_basic_authentication.rb +13 -0
- data/spec/support/artifice/endpoint_extra.rb +27 -0
- data/spec/support/artifice/endpoint_extra_missing.rb +15 -0
- data/spec/support/artifice/endpoint_fallback.rb +18 -0
- data/spec/support/artifice/endpoint_marshal_fail.rb +11 -0
- data/spec/support/artifice/endpoint_redirect.rb +15 -0
- data/spec/support/builders.rb +604 -0
- data/spec/support/fakeweb/rack-1.0.0.marshal +2 -0
- data/spec/support/fakeweb/windows.rb +23 -0
- data/spec/support/helpers.rb +317 -0
- data/spec/support/indexes.rb +112 -0
- data/spec/support/matchers.rb +77 -0
- data/spec/support/path.rb +73 -0
- data/spec/support/platforms.rb +86 -0
- data/spec/support/ruby_ext.rb +20 -0
- data/spec/support/rubygems_ext.rb +37 -0
- data/spec/support/rubygems_hax/platform.rb +22 -0
- data/spec/support/sudo.rb +21 -0
- data/spec/update/gems_spec.rb +134 -0
- data/spec/update/git_spec.rb +196 -0
- data/spec/update/source_spec.rb +51 -0
- metadata +338 -0
@@ -0,0 +1,313 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle flex_install" do
|
4
|
+
it "installs the gems as expected" do
|
5
|
+
install_gemfile <<-G
|
6
|
+
source "file://#{gem_repo1}"
|
7
|
+
gem 'rack'
|
8
|
+
G
|
9
|
+
|
10
|
+
should_be_installed "rack 1.0.0"
|
11
|
+
should_be_locked
|
12
|
+
end
|
13
|
+
|
14
|
+
it "installs even when the lockfile is invalid" do
|
15
|
+
install_gemfile <<-G
|
16
|
+
source "file://#{gem_repo1}"
|
17
|
+
gem 'rack'
|
18
|
+
G
|
19
|
+
|
20
|
+
should_be_installed "rack 1.0.0"
|
21
|
+
should_be_locked
|
22
|
+
|
23
|
+
gemfile <<-G
|
24
|
+
source "file://#{gem_repo1}"
|
25
|
+
gem 'rack', '1.0'
|
26
|
+
G
|
27
|
+
|
28
|
+
bundle :install
|
29
|
+
should_be_installed "rack 1.0.0"
|
30
|
+
should_be_locked
|
31
|
+
end
|
32
|
+
|
33
|
+
it "keeps child dependencies at the same version" do
|
34
|
+
build_repo2
|
35
|
+
|
36
|
+
install_gemfile <<-G
|
37
|
+
source "file://#{gem_repo2}"
|
38
|
+
gem "rack-obama"
|
39
|
+
G
|
40
|
+
|
41
|
+
should_be_installed "rack 1.0.0", "rack-obama 1.0.0"
|
42
|
+
|
43
|
+
update_repo2
|
44
|
+
install_gemfile <<-G
|
45
|
+
source "file://#{gem_repo2}"
|
46
|
+
gem "rack-obama", "1.0"
|
47
|
+
G
|
48
|
+
|
49
|
+
should_be_installed "rack 1.0.0", "rack-obama 1.0.0"
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "adding new gems" do
|
53
|
+
it "installs added gems without updating previously installed gems" do
|
54
|
+
build_repo2
|
55
|
+
|
56
|
+
install_gemfile <<-G
|
57
|
+
source "file://#{gem_repo2}"
|
58
|
+
gem 'rack'
|
59
|
+
G
|
60
|
+
|
61
|
+
update_repo2
|
62
|
+
|
63
|
+
install_gemfile <<-G
|
64
|
+
source "file://#{gem_repo2}"
|
65
|
+
gem 'rack'
|
66
|
+
gem 'activesupport', '2.3.5'
|
67
|
+
G
|
68
|
+
|
69
|
+
should_be_installed "rack 1.0.0", 'activesupport 2.3.5'
|
70
|
+
end
|
71
|
+
|
72
|
+
it "keeps child dependencies pinned" do
|
73
|
+
build_repo2
|
74
|
+
|
75
|
+
install_gemfile <<-G
|
76
|
+
source "file://#{gem_repo2}"
|
77
|
+
gem "rack-obama"
|
78
|
+
G
|
79
|
+
|
80
|
+
update_repo2
|
81
|
+
|
82
|
+
install_gemfile <<-G
|
83
|
+
source "file://#{gem_repo2}"
|
84
|
+
gem "rack-obama"
|
85
|
+
gem "thin"
|
86
|
+
G
|
87
|
+
|
88
|
+
should_be_installed "rack 1.0.0", 'rack-obama 1.0', 'thin 1.0'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "removing gems" do
|
93
|
+
it "removes gems without changing the versions of remaining gems" do
|
94
|
+
build_repo2
|
95
|
+
install_gemfile <<-G
|
96
|
+
source "file://#{gem_repo2}"
|
97
|
+
gem 'rack'
|
98
|
+
gem 'activesupport', '2.3.5'
|
99
|
+
G
|
100
|
+
|
101
|
+
update_repo2
|
102
|
+
|
103
|
+
install_gemfile <<-G
|
104
|
+
source "file://#{gem_repo2}"
|
105
|
+
gem 'rack'
|
106
|
+
G
|
107
|
+
|
108
|
+
should_be_installed "rack 1.0.0"
|
109
|
+
should_not_be_installed "activesupport 2.3.5"
|
110
|
+
|
111
|
+
install_gemfile <<-G
|
112
|
+
source "file://#{gem_repo2}"
|
113
|
+
gem 'rack'
|
114
|
+
gem 'activesupport', '2.3.2'
|
115
|
+
G
|
116
|
+
|
117
|
+
should_be_installed "rack 1.0.0", 'activesupport 2.3.2'
|
118
|
+
end
|
119
|
+
|
120
|
+
it "removes top level dependencies when removed from the Gemfile while leaving other dependencies intact" do
|
121
|
+
build_repo2
|
122
|
+
install_gemfile <<-G
|
123
|
+
source "file://#{gem_repo2}"
|
124
|
+
gem 'rack'
|
125
|
+
gem 'activesupport', '2.3.5'
|
126
|
+
G
|
127
|
+
|
128
|
+
update_repo2
|
129
|
+
|
130
|
+
install_gemfile <<-G
|
131
|
+
source "file://#{gem_repo2}"
|
132
|
+
gem 'rack'
|
133
|
+
G
|
134
|
+
|
135
|
+
should_not_be_installed "activesupport 2.3.5"
|
136
|
+
end
|
137
|
+
|
138
|
+
it "removes child dependencies" do
|
139
|
+
build_repo2
|
140
|
+
install_gemfile <<-G
|
141
|
+
source "file://#{gem_repo2}"
|
142
|
+
gem 'rack-obama'
|
143
|
+
gem 'activesupport'
|
144
|
+
G
|
145
|
+
|
146
|
+
should_be_installed "rack 1.0.0", "rack-obama 1.0.0", "activesupport 2.3.5"
|
147
|
+
|
148
|
+
update_repo2
|
149
|
+
install_gemfile <<-G
|
150
|
+
source "file://#{gem_repo2}"
|
151
|
+
gem 'activesupport'
|
152
|
+
G
|
153
|
+
|
154
|
+
should_be_installed 'activesupport 2.3.5'
|
155
|
+
should_not_be_installed "rack-obama", "rack"
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
describe "when Gemfile conflicts with lockfile" do
|
160
|
+
before(:each) do
|
161
|
+
build_repo2
|
162
|
+
install_gemfile <<-G
|
163
|
+
source "file://#{gem_repo2}"
|
164
|
+
gem "rack_middleware"
|
165
|
+
G
|
166
|
+
|
167
|
+
should_be_installed "rack_middleware 1.0", "rack 0.9.1"
|
168
|
+
|
169
|
+
build_repo2
|
170
|
+
update_repo2 do
|
171
|
+
build_gem "rack-obama", "2.0" do |s|
|
172
|
+
s.add_dependency "rack", "=1.2"
|
173
|
+
end
|
174
|
+
build_gem "rack_middleware", "2.0" do |s|
|
175
|
+
s.add_dependency "rack", ">=1.0"
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
gemfile <<-G
|
180
|
+
source "file://#{gem_repo2}"
|
181
|
+
gem "rack-obama", "2.0"
|
182
|
+
gem "rack_middleware"
|
183
|
+
G
|
184
|
+
end
|
185
|
+
|
186
|
+
it "does not install gems whose dependencies are not met" do
|
187
|
+
bundle :install
|
188
|
+
ruby <<-RUBY, :expect_err => true
|
189
|
+
require 'bundler/setup'
|
190
|
+
RUBY
|
191
|
+
err.should =~ /could not find gem 'rack-obama/i
|
192
|
+
end
|
193
|
+
|
194
|
+
it "suggests bundle update when the Gemfile requires different versions than the lock" do
|
195
|
+
nice_error = <<-E.strip.gsub(/^ {8}/, '')
|
196
|
+
Fetching source index from file:#{gem_repo2}/
|
197
|
+
Bundler could not find compatible versions for gem "rack":
|
198
|
+
In snapshot (Gemfile.lock):
|
199
|
+
rack (0.9.1)
|
200
|
+
|
201
|
+
In Gemfile:
|
202
|
+
rack-obama (= 2.0) ruby depends on
|
203
|
+
rack (= 1.2) ruby
|
204
|
+
|
205
|
+
Running `bundle update` will rebuild your snapshot from scratch, using only
|
206
|
+
the gems in your Gemfile, which may resolve the conflict.
|
207
|
+
E
|
208
|
+
|
209
|
+
bundle :install
|
210
|
+
out.should == nice_error
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
describe "subtler cases" do
|
215
|
+
before :each do
|
216
|
+
install_gemfile <<-G
|
217
|
+
source "file://#{gem_repo1}"
|
218
|
+
gem "rack"
|
219
|
+
gem "rack-obama"
|
220
|
+
G
|
221
|
+
|
222
|
+
gemfile <<-G
|
223
|
+
source "file://#{gem_repo1}"
|
224
|
+
gem "rack", "0.9.1"
|
225
|
+
gem "rack-obama"
|
226
|
+
G
|
227
|
+
end
|
228
|
+
|
229
|
+
it "does something" do
|
230
|
+
lambda {
|
231
|
+
bundle "install"
|
232
|
+
}.should_not change { File.read(bundled_app('Gemfile.lock')) }
|
233
|
+
|
234
|
+
out.should include('rack = 0.9.1')
|
235
|
+
out.should include('locked at 1.0.0')
|
236
|
+
out.should include('bundle update rack')
|
237
|
+
end
|
238
|
+
|
239
|
+
it "should work when you update" do
|
240
|
+
bundle "update rack"
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
describe "when adding a new source" do
|
245
|
+
it "updates the lockfile" do
|
246
|
+
build_repo2
|
247
|
+
install_gemfile <<-G
|
248
|
+
source "file://#{gem_repo1}"
|
249
|
+
gem "rack"
|
250
|
+
G
|
251
|
+
install_gemfile <<-G
|
252
|
+
source "file://#{gem_repo1}"
|
253
|
+
source "file://#{gem_repo2}"
|
254
|
+
gem "rack"
|
255
|
+
G
|
256
|
+
|
257
|
+
lockfile_should_be <<-L
|
258
|
+
GEM
|
259
|
+
remote: file:#{gem_repo1}/
|
260
|
+
remote: file:#{gem_repo2}/
|
261
|
+
specs:
|
262
|
+
rack (1.0.0)
|
263
|
+
|
264
|
+
PLATFORMS
|
265
|
+
ruby
|
266
|
+
|
267
|
+
DEPENDENCIES
|
268
|
+
rack
|
269
|
+
L
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
# This was written to test github issue #636, but it passed.
|
274
|
+
# It's insanoly slow (3.36s) so I'm not going to run it
|
275
|
+
# describe "when a locked child dependency conflicts" do
|
276
|
+
# before(:each) do
|
277
|
+
# build_repo2 do
|
278
|
+
# build_gem "capybara", "0.3.9" do |s|
|
279
|
+
# s.add_dependency "rack", ">= 1.0.0"
|
280
|
+
# end
|
281
|
+
#
|
282
|
+
# build_gem "rack", "1.1.0"
|
283
|
+
# build_gem "rails", "3.0.0.rc4" do |s|
|
284
|
+
# s.add_dependency "rack", "~> 1.1.0"
|
285
|
+
# end
|
286
|
+
#
|
287
|
+
# build_gem "rack", "1.2.1"
|
288
|
+
# build_gem "rails", "3.0.0" do |s|
|
289
|
+
# s.add_dependency "rack", "~> 1.2.1"
|
290
|
+
# end
|
291
|
+
# end
|
292
|
+
# end
|
293
|
+
#
|
294
|
+
# it "prints the correct error message" do
|
295
|
+
# # install Rails 3.0.0.rc
|
296
|
+
# install_gemfile <<-G
|
297
|
+
# source "file://#{gem_repo2}"
|
298
|
+
# gem "rails", "3.0.0.rc4"
|
299
|
+
# gem "capybara", "0.3.9"
|
300
|
+
# G
|
301
|
+
#
|
302
|
+
# # upgrade Rails to 3.0.0 and then install again
|
303
|
+
# install_gemfile <<-G
|
304
|
+
# source "file://#{gem_repo2}"
|
305
|
+
# gem "rails", "3.0.0"
|
306
|
+
# gem "capybara", "0.3.9"
|
307
|
+
# G
|
308
|
+
#
|
309
|
+
# out.should match(/Gemfile.lock/)
|
310
|
+
# end
|
311
|
+
# end
|
312
|
+
|
313
|
+
end
|
@@ -0,0 +1,268 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle install with gem sources" do
|
4
|
+
describe "with groups" do
|
5
|
+
describe "installing with no options" do
|
6
|
+
before :each do
|
7
|
+
install_gemfile <<-G
|
8
|
+
source "file://#{gem_repo1}"
|
9
|
+
gem "rack"
|
10
|
+
group :emo do
|
11
|
+
gem "activesupport", "2.3.5"
|
12
|
+
end
|
13
|
+
gem "thin", :groups => [:emo]
|
14
|
+
G
|
15
|
+
end
|
16
|
+
|
17
|
+
it "installs gems in the default group" do
|
18
|
+
should_be_installed "rack 1.0.0"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "installs gems in a group block into that group" do
|
22
|
+
should_be_installed "activesupport 2.3.5"
|
23
|
+
|
24
|
+
load_error_run <<-R, 'activesupport', :default
|
25
|
+
require 'activesupport'
|
26
|
+
puts ACTIVESUPPORT
|
27
|
+
R
|
28
|
+
|
29
|
+
err.should == "ZOMG LOAD ERROR"
|
30
|
+
end
|
31
|
+
|
32
|
+
it "installs gems with inline :groups into those groups" do
|
33
|
+
should_be_installed "thin 1.0"
|
34
|
+
|
35
|
+
load_error_run <<-R, 'thin', :default
|
36
|
+
require 'thin'
|
37
|
+
puts THIN
|
38
|
+
R
|
39
|
+
|
40
|
+
err.should == "ZOMG LOAD ERROR"
|
41
|
+
end
|
42
|
+
|
43
|
+
it "sets up everything if Bundler.setup is used with no groups" do
|
44
|
+
out = run("require 'rack'; puts RACK")
|
45
|
+
out.should eq('1.0.0')
|
46
|
+
|
47
|
+
out = run("require 'activesupport'; puts ACTIVESUPPORT")
|
48
|
+
out.should eq('2.3.5')
|
49
|
+
|
50
|
+
out = run("require 'thin'; puts THIN")
|
51
|
+
out.should eq('1.0')
|
52
|
+
end
|
53
|
+
|
54
|
+
it "removes old groups when new groups are set up" do
|
55
|
+
load_error_run <<-RUBY, 'thin', :emo
|
56
|
+
Bundler.setup(:default)
|
57
|
+
require 'thin'
|
58
|
+
puts THIN
|
59
|
+
RUBY
|
60
|
+
|
61
|
+
err.should == "ZOMG LOAD ERROR"
|
62
|
+
end
|
63
|
+
|
64
|
+
it "sets up old groups when they have previously been removed" do
|
65
|
+
out = run <<-RUBY, :emo
|
66
|
+
Bundler.setup(:default)
|
67
|
+
Bundler.setup(:default, :emo)
|
68
|
+
require 'thin'; puts THIN
|
69
|
+
RUBY
|
70
|
+
out.should == '1.0'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "installing --without" do
|
75
|
+
describe "with gems assigned to a single group" do
|
76
|
+
before :each do
|
77
|
+
gemfile <<-G
|
78
|
+
source "file://#{gem_repo1}"
|
79
|
+
gem "rack"
|
80
|
+
group :emo do
|
81
|
+
gem "activesupport", "2.3.5"
|
82
|
+
end
|
83
|
+
G
|
84
|
+
end
|
85
|
+
|
86
|
+
it "installs gems in the default group" do
|
87
|
+
bundle :install, :without => "emo"
|
88
|
+
should_be_installed "rack 1.0.0", :groups => [:default]
|
89
|
+
end
|
90
|
+
|
91
|
+
it "does not install gems from the excluded group" do
|
92
|
+
bundle :install, :without => "emo"
|
93
|
+
should_not_be_installed "activesupport 2.3.5", :groups => [:default]
|
94
|
+
end
|
95
|
+
|
96
|
+
it "does not install gems from the previously excluded group" do
|
97
|
+
bundle :install, :without => "emo"
|
98
|
+
should_not_be_installed "activesupport 2.3.5"
|
99
|
+
bundle :install
|
100
|
+
should_not_be_installed "activesupport 2.3.5"
|
101
|
+
end
|
102
|
+
|
103
|
+
it "does not say it installed gems from the excluded group" do
|
104
|
+
bundle :install, :without => "emo"
|
105
|
+
out.should_not include("activesupport")
|
106
|
+
end
|
107
|
+
|
108
|
+
it "allows Bundler.setup for specific groups" do
|
109
|
+
bundle :install, :without => "emo"
|
110
|
+
run("require 'rack'; puts RACK", :default)
|
111
|
+
out.should == '1.0.0'
|
112
|
+
end
|
113
|
+
|
114
|
+
it "does not effect the resolve" do
|
115
|
+
gemfile <<-G
|
116
|
+
source "file://#{gem_repo1}"
|
117
|
+
gem "activesupport"
|
118
|
+
group :emo do
|
119
|
+
gem "rails", "2.3.2"
|
120
|
+
end
|
121
|
+
G
|
122
|
+
|
123
|
+
bundle :install, :without => "emo"
|
124
|
+
should_be_installed "activesupport 2.3.2", :groups => [:default]
|
125
|
+
end
|
126
|
+
|
127
|
+
it "still works on a different machine and excludes gems" do
|
128
|
+
bundle :install, :without => "emo"
|
129
|
+
|
130
|
+
simulate_new_machine
|
131
|
+
bundle :install, :without => "emo"
|
132
|
+
|
133
|
+
should_be_installed "rack 1.0.0", :groups => [:default]
|
134
|
+
should_not_be_installed "activesupport 2.3.5", :groups => [:default]
|
135
|
+
end
|
136
|
+
|
137
|
+
it "still works when BUNDLE_WITHOUT is set" do
|
138
|
+
ENV["BUNDLE_WITHOUT"] = "emo"
|
139
|
+
|
140
|
+
bundle :install
|
141
|
+
out.should_not include("activesupport")
|
142
|
+
|
143
|
+
should_be_installed "rack 1.0.0", :groups => [:default]
|
144
|
+
should_not_be_installed "activesupport 2.3.5", :groups => [:default]
|
145
|
+
|
146
|
+
ENV["BUNDLE_WITHOUT"] = nil
|
147
|
+
end
|
148
|
+
|
149
|
+
it "clears without when passed an empty list" do
|
150
|
+
bundle :install, :without => "emo"
|
151
|
+
|
152
|
+
bundle 'install --without ""'
|
153
|
+
should_be_installed "activesupport 2.3.5"
|
154
|
+
end
|
155
|
+
|
156
|
+
it "doesn't clear without when nothing is passed" do
|
157
|
+
bundle :install, :without => "emo"
|
158
|
+
|
159
|
+
bundle :install
|
160
|
+
should_not_be_installed "activesupport 2.3.5"
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
describe "with gems assigned to multiple groups" do
|
165
|
+
before :each do
|
166
|
+
gemfile <<-G
|
167
|
+
source "file://#{gem_repo1}"
|
168
|
+
gem "rack"
|
169
|
+
group :emo, :lolercoaster do
|
170
|
+
gem "activesupport", "2.3.5"
|
171
|
+
end
|
172
|
+
G
|
173
|
+
end
|
174
|
+
|
175
|
+
it "installs gems in the default group" do
|
176
|
+
bundle :install, :without => "emo lolercoaster"
|
177
|
+
should_be_installed "rack 1.0.0"
|
178
|
+
end
|
179
|
+
|
180
|
+
it "installs the gem if any of its groups are installed" do
|
181
|
+
bundle "install --without emo"
|
182
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
183
|
+
end
|
184
|
+
|
185
|
+
it "works when locked as well" do
|
186
|
+
bundle "install --without emo"
|
187
|
+
bundle "lock"
|
188
|
+
|
189
|
+
simulate_new_machine
|
190
|
+
|
191
|
+
bundle "install --without lolercoaster"
|
192
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
193
|
+
end
|
194
|
+
|
195
|
+
describe "with a gem defined multiple times in different groups" do
|
196
|
+
before :each do
|
197
|
+
gemfile <<-G
|
198
|
+
source "file://#{gem_repo1}"
|
199
|
+
gem "rack"
|
200
|
+
|
201
|
+
group :emo do
|
202
|
+
gem "activesupport", "2.3.5"
|
203
|
+
end
|
204
|
+
|
205
|
+
group :lolercoaster do
|
206
|
+
gem "activesupport", "2.3.5"
|
207
|
+
end
|
208
|
+
G
|
209
|
+
end
|
210
|
+
|
211
|
+
it "installs the gem w/ option --without emo" do
|
212
|
+
bundle "install --without emo"
|
213
|
+
should_be_installed "activesupport 2.3.5"
|
214
|
+
end
|
215
|
+
|
216
|
+
it "installs the gem w/ option --without lolercoaster" do
|
217
|
+
bundle "install --without lolercoaster"
|
218
|
+
should_be_installed "activesupport 2.3.5"
|
219
|
+
end
|
220
|
+
|
221
|
+
it "does not install the gem w/ option --without emo lolercoaster" do
|
222
|
+
bundle "install --without emo lolercoaster"
|
223
|
+
should_not_be_installed "activesupport 2.3.5"
|
224
|
+
end
|
225
|
+
|
226
|
+
it "does not install the gem w/ option --without 'emo lolercoaster'" do
|
227
|
+
bundle "install --without 'emo lolercoaster'"
|
228
|
+
should_not_be_installed "activesupport 2.3.5"
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
describe "nesting groups" do
|
234
|
+
before :each do
|
235
|
+
gemfile <<-G
|
236
|
+
source "file://#{gem_repo1}"
|
237
|
+
gem "rack"
|
238
|
+
group :emo do
|
239
|
+
group :lolercoaster do
|
240
|
+
gem "activesupport", "2.3.5"
|
241
|
+
end
|
242
|
+
end
|
243
|
+
G
|
244
|
+
end
|
245
|
+
|
246
|
+
it "installs gems in the default group" do
|
247
|
+
bundle :install, :without => "emo lolercoaster"
|
248
|
+
should_be_installed "rack 1.0.0"
|
249
|
+
end
|
250
|
+
|
251
|
+
it "installs the gem if any of its groups are installed" do
|
252
|
+
bundle "install --without emo"
|
253
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
254
|
+
end
|
255
|
+
|
256
|
+
it "works when locked as well" do
|
257
|
+
bundle "install --without emo"
|
258
|
+
bundle "lock"
|
259
|
+
|
260
|
+
simulate_new_machine
|
261
|
+
|
262
|
+
bundle "install --without lolercoaster"
|
263
|
+
should_be_installed "rack 1.0.0", "activesupport 2.3.5"
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|