bundler 1.1.5 → 1.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- data/.travis.yml +10 -7
- data/CHANGELOG.md +27 -8
- data/ISSUES.md +20 -16
- data/README.md +2 -0
- data/Rakefile +6 -5
- data/bin/bundle +5 -3
- data/lib/bundler.rb +33 -13
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/cli.rb +108 -20
- data/lib/bundler/definition.rb +76 -20
- data/lib/bundler/deployment.rb +4 -4
- data/lib/bundler/dsl.rb +26 -25
- data/lib/bundler/fetcher.rb +4 -13
- data/lib/bundler/gem_helper.rb +17 -5
- data/lib/bundler/graph.rb +10 -10
- data/lib/bundler/installer.rb +34 -2
- data/lib/bundler/ruby_version.rb +94 -0
- data/lib/bundler/runtime.rb +1 -1
- data/lib/bundler/settings.rb +18 -13
- data/lib/bundler/source.rb +316 -150
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/vendor/thor/parser/options.rb +0 -3
- data/lib/bundler/vendored_thor.rb +1 -2
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-config.ronn +8 -0
- data/man/bundle-install.ronn +6 -0
- data/man/bundle-package.ronn +3 -3
- data/man/gemfile.5.ronn +16 -3
- data/spec/bundler/dsl_spec.rb +23 -26
- data/spec/bundler/gem_helper_spec.rb +31 -0
- data/spec/cache/gems_spec.rb +10 -1
- data/spec/cache/git_spec.rb +114 -2
- data/spec/cache/path_spec.rb +85 -9
- data/spec/install/gems/dependency_api_spec.rb +21 -42
- data/spec/install/git_spec.rb +149 -1
- data/spec/lock/lockfile_spec.rb +1 -1
- data/spec/other/config_spec.rb +120 -22
- data/spec/other/newgem_spec.rb +2 -0
- data/spec/other/platform_spec.rb +881 -0
- data/spec/support/helpers.rb +12 -1
- data/spec/support/platforms.rb +33 -0
- data/spec/support/rubygems_hax/platform.rb +12 -1
- data/spec/update/gems_spec.rb +12 -0
- metadata +9 -8
- data/lib/bundler/vendored_persistent.rb +0 -3
- data/spec/install/deprecated_spec.rb +0 -36
@@ -158,15 +158,28 @@ describe "gemcutter's dependency API" do
|
|
158
158
|
out.should match(/Too many redirects/)
|
159
159
|
end
|
160
160
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
161
|
+
context "when --full-index is specified" do
|
162
|
+
it "should use the modern index for install" do
|
163
|
+
gemfile <<-G
|
164
|
+
source "#{source_uri}"
|
165
|
+
gem "rack"
|
166
|
+
G
|
166
167
|
|
167
|
-
|
168
|
-
|
169
|
-
|
168
|
+
bundle "install --full-index", :artifice => "endpoint"
|
169
|
+
out.should include("Fetching source index from #{source_uri}")
|
170
|
+
should_be_installed "rack 1.0.0"
|
171
|
+
end
|
172
|
+
|
173
|
+
it "should use the modern index for update" do
|
174
|
+
gemfile <<-G
|
175
|
+
source "#{source_uri}"
|
176
|
+
gem "rack"
|
177
|
+
G
|
178
|
+
|
179
|
+
bundle "update --full-index", :artifice => "endpoint"
|
180
|
+
out.should include("Fetching source index from #{source_uri}")
|
181
|
+
should_be_installed "rack 1.0.0"
|
182
|
+
end
|
170
183
|
end
|
171
184
|
|
172
185
|
it "fetches again when more dependencies are found in subsequent sources" do
|
@@ -386,38 +399,4 @@ OUTPUT
|
|
386
399
|
out.should_not include("#{user}:#{password}")
|
387
400
|
end
|
388
401
|
end
|
389
|
-
|
390
|
-
context "when ruby is compiled without openssl" do
|
391
|
-
before do
|
392
|
-
# Install a monkeypatch that reproduces the effects of openssl being
|
393
|
-
# missing when the fetcher runs, as happens in real life. The reason
|
394
|
-
# we can't just overwrite openssl.rb is that Artifice uses it.
|
395
|
-
bundled_app("broken_ssl").mkpath
|
396
|
-
bundled_app("broken_ssl/openssl.rb").open("w") do |f|
|
397
|
-
f.write <<-RUBY
|
398
|
-
$:.delete File.expand_path("..", __FILE__)
|
399
|
-
require 'openssl'
|
400
|
-
|
401
|
-
require 'bundler'
|
402
|
-
class Bundler::Fetcher
|
403
|
-
def fetch(*)
|
404
|
-
raise LoadError, "cannot load such file -- openssl"
|
405
|
-
end
|
406
|
-
end
|
407
|
-
RUBY
|
408
|
-
end
|
409
|
-
end
|
410
|
-
|
411
|
-
it "explains what to do to get it" do
|
412
|
-
gemfile <<-G
|
413
|
-
source "#{source_uri.gsub(/http/, 'https')}"
|
414
|
-
gem "rack"
|
415
|
-
G
|
416
|
-
|
417
|
-
bundle :install, :artifice => "endpoint",
|
418
|
-
:env => {"RUBYOPT" => "-I#{bundled_app("broken_ssl")}"}
|
419
|
-
out.should include("Could not load OpenSSL.")
|
420
|
-
end
|
421
|
-
end
|
422
|
-
|
423
402
|
end
|
data/spec/install/git_spec.rb
CHANGED
@@ -156,6 +156,155 @@ describe "bundle install with git sources" do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
+
describe "when specifying local" do
|
160
|
+
it "uses the local repository instead of checking a new one out" do
|
161
|
+
# We don't generate it because we actually don't need it
|
162
|
+
# build_git "rack", "0.8"
|
163
|
+
|
164
|
+
build_git "rack", "0.8", :path => lib_path('local-rack') do |s|
|
165
|
+
s.write "lib/rack.rb", "puts :LOCAL"
|
166
|
+
end
|
167
|
+
|
168
|
+
gemfile <<-G
|
169
|
+
source "file://#{gem_repo1}"
|
170
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
171
|
+
G
|
172
|
+
|
173
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
174
|
+
bundle :install
|
175
|
+
out.should =~ /at #{lib_path('local-rack')}/
|
176
|
+
|
177
|
+
run "require 'rack'"
|
178
|
+
out.should == "LOCAL"
|
179
|
+
end
|
180
|
+
|
181
|
+
it "chooses the local repository on runtime" do
|
182
|
+
build_git "rack", "0.8"
|
183
|
+
|
184
|
+
FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack'))
|
185
|
+
|
186
|
+
update_git "rack", "0.8", :path => lib_path('local-rack') do |s|
|
187
|
+
s.write "lib/rack.rb", "puts :LOCAL"
|
188
|
+
end
|
189
|
+
|
190
|
+
install_gemfile <<-G
|
191
|
+
source "file://#{gem_repo1}"
|
192
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
193
|
+
G
|
194
|
+
|
195
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
196
|
+
run "require 'rack'"
|
197
|
+
out.should == "LOCAL"
|
198
|
+
end
|
199
|
+
|
200
|
+
it "updates specs on runtime" do
|
201
|
+
system_gems "nokogiri-1.4.2"
|
202
|
+
|
203
|
+
build_git "rack", "0.8"
|
204
|
+
|
205
|
+
install_gemfile <<-G
|
206
|
+
source "file://#{gem_repo1}"
|
207
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
208
|
+
G
|
209
|
+
|
210
|
+
lockfile0 = File.read(bundled_app("Gemfile.lock"))
|
211
|
+
|
212
|
+
FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack'))
|
213
|
+
update_git "rack", "0.8", :path => lib_path('local-rack') do |s|
|
214
|
+
s.add_dependency "nokogiri", "1.4.2"
|
215
|
+
end
|
216
|
+
|
217
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
218
|
+
run "require 'rack'"
|
219
|
+
|
220
|
+
lockfile1 = File.read(bundled_app("Gemfile.lock"))
|
221
|
+
lockfile1.should_not == lockfile0
|
222
|
+
end
|
223
|
+
|
224
|
+
it "updates ref on install" do
|
225
|
+
build_git "rack", "0.8"
|
226
|
+
|
227
|
+
install_gemfile <<-G
|
228
|
+
source "file://#{gem_repo1}"
|
229
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
230
|
+
G
|
231
|
+
|
232
|
+
lockfile0 = File.read(bundled_app("Gemfile.lock"))
|
233
|
+
|
234
|
+
FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack'))
|
235
|
+
update_git "rack", "0.8", :path => lib_path('local-rack')
|
236
|
+
|
237
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
238
|
+
bundle :install
|
239
|
+
|
240
|
+
lockfile1 = File.read(bundled_app("Gemfile.lock"))
|
241
|
+
lockfile1.should_not == lockfile0
|
242
|
+
end
|
243
|
+
|
244
|
+
it "explodes if given path does not exist" do
|
245
|
+
build_git "rack", "0.8"
|
246
|
+
|
247
|
+
install_gemfile <<-G
|
248
|
+
source "file://#{gem_repo1}"
|
249
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
250
|
+
G
|
251
|
+
|
252
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
253
|
+
bundle :install
|
254
|
+
out.should =~ /Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/
|
255
|
+
end
|
256
|
+
|
257
|
+
it "explodes if branch is not given" do
|
258
|
+
build_git "rack", "0.8"
|
259
|
+
FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack'))
|
260
|
+
|
261
|
+
install_gemfile <<-G
|
262
|
+
source "file://#{gem_repo1}"
|
263
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}"
|
264
|
+
G
|
265
|
+
|
266
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
267
|
+
bundle :install
|
268
|
+
out.should =~ /because :branch is not specified in Gemfile/
|
269
|
+
end
|
270
|
+
|
271
|
+
it "explodes on different branches" do
|
272
|
+
build_git "rack", "0.8"
|
273
|
+
|
274
|
+
FileUtils.cp_r("#{lib_path('rack-0.8')}/.", lib_path('local-rack'))
|
275
|
+
|
276
|
+
update_git "rack", "0.8", :path => lib_path('local-rack'), :branch => "another" do |s|
|
277
|
+
s.write "lib/rack.rb", "puts :LOCAL"
|
278
|
+
end
|
279
|
+
|
280
|
+
install_gemfile <<-G
|
281
|
+
source "file://#{gem_repo1}"
|
282
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
283
|
+
G
|
284
|
+
|
285
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
286
|
+
bundle :install
|
287
|
+
out.should =~ /is using branch another but Gemfile specifies master/
|
288
|
+
end
|
289
|
+
|
290
|
+
it "explodes on invalid revision" do
|
291
|
+
build_git "rack", "0.8"
|
292
|
+
|
293
|
+
build_git "rack", "0.8", :path => lib_path('local-rack') do |s|
|
294
|
+
s.write "lib/rack.rb", "puts :LOCAL"
|
295
|
+
end
|
296
|
+
|
297
|
+
install_gemfile <<-G
|
298
|
+
source "file://#{gem_repo1}"
|
299
|
+
gem "rack", :git => "#{lib_path('rack-0.8')}", :branch => "master"
|
300
|
+
G
|
301
|
+
|
302
|
+
bundle %|config local.rack #{lib_path('local-rack')}|
|
303
|
+
bundle :install
|
304
|
+
out.should =~ /The Gemfile lock is pointing to revision \w+/
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
159
308
|
describe "specified inline" do
|
160
309
|
# TODO: Figure out how to write this test so that it is not flaky depending
|
161
310
|
# on the current network situation.
|
@@ -573,7 +722,6 @@ describe "bundle install with git sources" do
|
|
573
722
|
|
574
723
|
install_gemfile <<-G
|
575
724
|
source "file://#{gem_repo1}"
|
576
|
-
|
577
725
|
gem "valim", "= 1.0", :git => "#{lib_path('valim')}"
|
578
726
|
G
|
579
727
|
|
data/spec/lock/lockfile_spec.rb
CHANGED
@@ -646,7 +646,7 @@ describe "the lockfile format" do
|
|
646
646
|
G
|
647
647
|
|
648
648
|
bundled_app("Gemfile.lock").should_not exist
|
649
|
-
out.should include "rack (>= 0) should come from an
|
649
|
+
out.should include "rack (>= 0) should come from an unspecfied source and git://hubz.com (at master)"
|
650
650
|
end
|
651
651
|
|
652
652
|
it "works correctly with multiple version dependencies" do
|
data/spec/other/config_spec.rb
CHANGED
@@ -8,33 +8,131 @@ describe ".bundle/config" do
|
|
8
8
|
G
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
describe "BUNDLE_APP_CONFIG" do
|
12
|
+
it "can be moved with an environment variable" do
|
13
|
+
ENV['BUNDLE_APP_CONFIG'] = tmp('foo/bar').to_s
|
14
|
+
bundle "install --path vendor/bundle"
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
bundled_app('.bundle').should_not exist
|
17
|
+
tmp('foo/bar/config').should exist
|
18
|
+
should_be_installed "rack 1.0.0"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "can provide a relative path with the environment variable" do
|
22
|
+
FileUtils.mkdir_p bundled_app('omg')
|
23
|
+
Dir.chdir bundled_app('omg')
|
24
|
+
|
25
|
+
ENV['BUNDLE_APP_CONFIG'] = "../foo"
|
26
|
+
bundle "install --path vendor/bundle"
|
27
|
+
|
28
|
+
bundled_app(".bundle").should_not exist
|
29
|
+
bundled_app("../foo/config").should exist
|
30
|
+
should_be_installed "rack 1.0.0"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "removes environment.rb from BUNDLE_APP_CONFIG's path" do
|
34
|
+
FileUtils.mkdir_p(tmp('foo/bar'))
|
35
|
+
ENV['BUNDLE_APP_CONFIG'] = tmp('foo/bar').to_s
|
36
|
+
bundle "install"
|
37
|
+
FileUtils.touch tmp('foo/bar/environment.rb')
|
38
|
+
should_be_installed "rack 1.0.0"
|
39
|
+
tmp('foo/bar/environment.rb').should_not exist
|
40
|
+
end
|
18
41
|
end
|
19
42
|
|
20
|
-
|
21
|
-
|
22
|
-
|
43
|
+
describe "global" do
|
44
|
+
before(:each) { bundle :install }
|
45
|
+
|
46
|
+
it "is the default" do
|
47
|
+
bundle "config foo global"
|
48
|
+
run "puts Bundler.settings[:foo]"
|
49
|
+
out.should == "global"
|
50
|
+
end
|
51
|
+
|
52
|
+
it "can also be set explicitly" do
|
53
|
+
bundle "config --global foo global"
|
54
|
+
run "puts Bundler.settings[:foo]"
|
55
|
+
out.should == "global"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "has lower precedence than local" do
|
59
|
+
bundle "config --local foo local"
|
60
|
+
|
61
|
+
bundle "config --global foo global"
|
62
|
+
out.should =~ /Your application has set foo to "local"/
|
63
|
+
|
64
|
+
run "puts Bundler.settings[:foo]"
|
65
|
+
out.should == "local"
|
66
|
+
end
|
67
|
+
|
68
|
+
it "has lower precedence than env" do
|
69
|
+
begin
|
70
|
+
ENV["BUNDLE_FOO"] = "env"
|
71
|
+
|
72
|
+
bundle "config --global foo global"
|
73
|
+
out.should =~ /You have a bundler environment variable for foo set to "env"/
|
23
74
|
|
24
|
-
|
25
|
-
|
75
|
+
run "puts Bundler.settings[:foo]"
|
76
|
+
out.should == "env"
|
77
|
+
ensure
|
78
|
+
ENV.delete("BUNDLE_FOO")
|
79
|
+
end
|
80
|
+
end
|
26
81
|
|
27
|
-
|
28
|
-
|
29
|
-
|
82
|
+
it "can be deleted" do
|
83
|
+
bundle "config --global foo global"
|
84
|
+
bundle "config --delete foo"
|
85
|
+
|
86
|
+
run "puts Bundler.settings[:foo] == nil"
|
87
|
+
out.should == "true"
|
88
|
+
end
|
89
|
+
|
90
|
+
it "warns when overriding" do
|
91
|
+
bundle "config --global foo previous"
|
92
|
+
bundle "config --global foo global"
|
93
|
+
out.should =~ /You are replacing the current global value of foo/
|
94
|
+
|
95
|
+
run "puts Bundler.settings[:foo]"
|
96
|
+
out.should == "global"
|
97
|
+
end
|
30
98
|
end
|
31
99
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
100
|
+
describe "local" do
|
101
|
+
before(:each) { bundle :install }
|
102
|
+
|
103
|
+
it "can also be set explicitly" do
|
104
|
+
bundle "config --local foo local"
|
105
|
+
run "puts Bundler.settings[:foo]"
|
106
|
+
out.should == "local"
|
107
|
+
end
|
108
|
+
|
109
|
+
it "has higher precedence than env" do
|
110
|
+
begin
|
111
|
+
ENV["BUNDLE_FOO"] = "env"
|
112
|
+
bundle "config --local foo local"
|
113
|
+
|
114
|
+
run "puts Bundler.settings[:foo]"
|
115
|
+
out.should == "local"
|
116
|
+
ensure
|
117
|
+
ENV.delete("BUNDLE_FOO")
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
it "can be deleted" do
|
122
|
+
bundle "config --local foo local"
|
123
|
+
bundle "config --delete foo"
|
124
|
+
|
125
|
+
run "puts Bundler.settings[:foo] == nil"
|
126
|
+
out.should == "true"
|
127
|
+
end
|
128
|
+
|
129
|
+
it "warns when overriding" do
|
130
|
+
bundle "config --local foo previous"
|
131
|
+
bundle "config --local foo local"
|
132
|
+
out.should =~ /You are replacing the current local value of foo/
|
133
|
+
|
134
|
+
run "puts Bundler.settings[:foo]"
|
135
|
+
out.should == "local"
|
136
|
+
end
|
39
137
|
end
|
40
|
-
end
|
138
|
+
end
|
data/spec/other/newgem_spec.rb
CHANGED
@@ -7,6 +7,8 @@ describe "bundle gem" do
|
|
7
7
|
@git_email = `git config --global user.email`.chomp
|
8
8
|
`git config --global user.email user@example.com`
|
9
9
|
bundle 'gem test-gem'
|
10
|
+
# reset gemspec cache for each test because of commit 3d4163a
|
11
|
+
Bundler.clear_gemspec_cache
|
10
12
|
end
|
11
13
|
|
12
14
|
after :each do
|
@@ -0,0 +1,881 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "bundle platform" do
|
4
|
+
context "without flags" do
|
5
|
+
it "returns all the output" do
|
6
|
+
gemfile <<-G
|
7
|
+
source "file://#{gem_repo1}"
|
8
|
+
|
9
|
+
#{ruby_version_correct}
|
10
|
+
|
11
|
+
gem "foo"
|
12
|
+
G
|
13
|
+
|
14
|
+
bundle "platform"
|
15
|
+
out.should == <<-G.chomp
|
16
|
+
Your platform is: #{RUBY_PLATFORM}
|
17
|
+
|
18
|
+
Your app has gems that work on these platforms:
|
19
|
+
* ruby
|
20
|
+
|
21
|
+
Your Gemfile specifies a Ruby version requirement:
|
22
|
+
* ruby #{RUBY_VERSION}
|
23
|
+
|
24
|
+
Your current platform satisfies the Ruby version requirement.
|
25
|
+
G
|
26
|
+
end
|
27
|
+
|
28
|
+
it "doesn't print ruby version requirement if it isn't specified" do
|
29
|
+
gemfile <<-G
|
30
|
+
source "file://#{gem_repo1}"
|
31
|
+
|
32
|
+
gem "foo"
|
33
|
+
G
|
34
|
+
|
35
|
+
bundle "platform"
|
36
|
+
out.should == <<-G.chomp
|
37
|
+
Your platform is: #{RUBY_PLATFORM}
|
38
|
+
|
39
|
+
Your app has gems that work on these platforms:
|
40
|
+
* ruby
|
41
|
+
|
42
|
+
Your Gemfile does not specify a Ruby version requirement.
|
43
|
+
G
|
44
|
+
end
|
45
|
+
|
46
|
+
it "doesn't match the ruby version requirement" do
|
47
|
+
gemfile <<-G
|
48
|
+
source "file://#{gem_repo1}"
|
49
|
+
|
50
|
+
#{ruby_version_incorrect}
|
51
|
+
|
52
|
+
gem "foo"
|
53
|
+
G
|
54
|
+
|
55
|
+
bundle "platform"
|
56
|
+
out.should == <<-G.chomp
|
57
|
+
Your platform is: #{RUBY_PLATFORM}
|
58
|
+
|
59
|
+
Your app has gems that work on these platforms:
|
60
|
+
* ruby
|
61
|
+
|
62
|
+
Your Gemfile specifies a Ruby version requirement:
|
63
|
+
* ruby #{not_local_ruby_version}
|
64
|
+
|
65
|
+
Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}
|
66
|
+
G
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context "--ruby" do
|
71
|
+
it "returns ruby version when explicit" do
|
72
|
+
gemfile <<-G
|
73
|
+
source "file://#{gem_repo1}"
|
74
|
+
ruby "1.9.3", :engine => 'ruby', :engine_version => '1.9.3'
|
75
|
+
|
76
|
+
gem "foo"
|
77
|
+
G
|
78
|
+
|
79
|
+
bundle "platform --ruby"
|
80
|
+
|
81
|
+
out.should eq("ruby 1.9.3")
|
82
|
+
end
|
83
|
+
|
84
|
+
it "engine defaults to MRI" do
|
85
|
+
gemfile <<-G
|
86
|
+
source "file://#{gem_repo1}"
|
87
|
+
ruby "1.9.3"
|
88
|
+
|
89
|
+
gem "foo"
|
90
|
+
G
|
91
|
+
|
92
|
+
bundle "platform --ruby"
|
93
|
+
|
94
|
+
out.should eq("ruby 1.9.3")
|
95
|
+
end
|
96
|
+
|
97
|
+
it "handles jruby" do
|
98
|
+
gemfile <<-G
|
99
|
+
source "file://#{gem_repo1}"
|
100
|
+
ruby "1.8.7", :engine => 'jruby', :engine_version => '1.6.5'
|
101
|
+
|
102
|
+
gem "foo"
|
103
|
+
G
|
104
|
+
|
105
|
+
bundle "platform --ruby"
|
106
|
+
|
107
|
+
out.should eq("ruby 1.8.7 (jruby 1.6.5)")
|
108
|
+
end
|
109
|
+
|
110
|
+
it "handles rbx" do
|
111
|
+
gemfile <<-G
|
112
|
+
source "file://#{gem_repo1}"
|
113
|
+
ruby "1.8.7", :engine => 'rbx', :engine_version => '1.2.4'
|
114
|
+
|
115
|
+
gem "foo"
|
116
|
+
G
|
117
|
+
|
118
|
+
bundle "platform --ruby"
|
119
|
+
|
120
|
+
out.should eq("ruby 1.8.7 (rbx 1.2.4)")
|
121
|
+
end
|
122
|
+
|
123
|
+
it "raises an error if engine is used but engine version is not" do
|
124
|
+
gemfile <<-G
|
125
|
+
source "file://#{gem_repo1}"
|
126
|
+
ruby "1.8.7", :engine => 'rbx'
|
127
|
+
|
128
|
+
gem "foo"
|
129
|
+
G
|
130
|
+
|
131
|
+
bundle "platform", :exitstatus => true
|
132
|
+
|
133
|
+
exitstatus.should_not == 0
|
134
|
+
end
|
135
|
+
|
136
|
+
it "raises an error if engine_version is used but engine is not" do
|
137
|
+
gemfile <<-G
|
138
|
+
source "file://#{gem_repo1}"
|
139
|
+
ruby "1.8.7", :engine_version => '1.2.4'
|
140
|
+
|
141
|
+
gem "foo"
|
142
|
+
G
|
143
|
+
|
144
|
+
bundle "platform", :exitstatus => true
|
145
|
+
|
146
|
+
exitstatus.should_not == 0
|
147
|
+
end
|
148
|
+
|
149
|
+
it "raises an error if engine version doesn't match ruby version for mri" do
|
150
|
+
gemfile <<-G
|
151
|
+
source "file://#{gem_repo1}"
|
152
|
+
ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
|
153
|
+
|
154
|
+
gem "foo"
|
155
|
+
G
|
156
|
+
|
157
|
+
bundle "platform", :exitstatus => true
|
158
|
+
|
159
|
+
exitstatus.should_not == 0
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
let(:ruby_version_correct) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{local_engine_version}\"" }
|
164
|
+
let(:ruby_version_incorrect) { "ruby \"#{not_local_ruby_version}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_ruby_version}\"" }
|
165
|
+
let(:engine_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{not_local_tag}\", :engine_version => \"#{RUBY_VERSION}\"" }
|
166
|
+
let(:engine_version_incorrect) { "ruby \"#{RUBY_VERSION}\", :engine => \"#{local_ruby_engine}\", :engine_version => \"#{not_local_engine_version}\"" }
|
167
|
+
|
168
|
+
def should_be_ruby_version_incorrect(opts = {:exitstatus => true})
|
169
|
+
exitstatus.should eq(18) if opts[:exitstatus]
|
170
|
+
out.should be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}")
|
171
|
+
end
|
172
|
+
|
173
|
+
def should_be_engine_incorrect(opts = {:exitstatus => true})
|
174
|
+
exitstatus.should eq(18) if opts[:exitstatus]
|
175
|
+
out.should be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}")
|
176
|
+
end
|
177
|
+
|
178
|
+
def should_be_engine_version_incorrect(opts = {:exitstatus => true})
|
179
|
+
exitstatus.should eq(18) if opts[:exitstatus]
|
180
|
+
out.should be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}")
|
181
|
+
end
|
182
|
+
|
183
|
+
context "bundle install" do
|
184
|
+
it "installs fine when the ruby version matches" do
|
185
|
+
install_gemfile <<-G
|
186
|
+
source "file://#{gem_repo1}"
|
187
|
+
gem "rack"
|
188
|
+
|
189
|
+
#{ruby_version_correct}
|
190
|
+
G
|
191
|
+
|
192
|
+
bundled_app('Gemfile.lock').should exist
|
193
|
+
end
|
194
|
+
|
195
|
+
it "doesn't install when the ruby version doesn't match" do
|
196
|
+
install_gemfile <<-G, :exitstatus => true
|
197
|
+
source "file://#{gem_repo1}"
|
198
|
+
gem "rack"
|
199
|
+
|
200
|
+
#{ruby_version_incorrect}
|
201
|
+
G
|
202
|
+
|
203
|
+
bundled_app('Gemfile.lock').should_not exist
|
204
|
+
should_be_ruby_version_incorrect
|
205
|
+
end
|
206
|
+
|
207
|
+
it "doesn't install when engine doesn't match" do
|
208
|
+
install_gemfile <<-G, :exitstatus => true
|
209
|
+
source "file://#{gem_repo1}"
|
210
|
+
gem "rack"
|
211
|
+
|
212
|
+
#{engine_incorrect}
|
213
|
+
G
|
214
|
+
|
215
|
+
bundled_app('Gemfile.lock').should_not exist
|
216
|
+
should_be_engine_incorrect
|
217
|
+
end
|
218
|
+
|
219
|
+
it "doesn't install when engine version doesn't match" do
|
220
|
+
simulate_ruby_engine "jruby" do
|
221
|
+
install_gemfile <<-G, :exitstatus => true
|
222
|
+
source "file://#{gem_repo1}"
|
223
|
+
gem "rack"
|
224
|
+
|
225
|
+
#{engine_version_incorrect}
|
226
|
+
G
|
227
|
+
|
228
|
+
bundled_app('Gemfile.lock').should_not exist
|
229
|
+
should_be_engine_version_incorrect
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
context "bundle check" do
|
235
|
+
it "checks fine when the ruby version matches" do
|
236
|
+
install_gemfile <<-G
|
237
|
+
source "file://#{gem_repo1}"
|
238
|
+
gem "rack"
|
239
|
+
G
|
240
|
+
|
241
|
+
gemfile <<-G
|
242
|
+
source "file://#{gem_repo1}"
|
243
|
+
gem "rack"
|
244
|
+
|
245
|
+
#{ruby_version_correct}
|
246
|
+
G
|
247
|
+
|
248
|
+
bundle :check, :exitstatus => true
|
249
|
+
exitstatus.should eq(0)
|
250
|
+
out.should == "The Gemfile's dependencies are satisfied"
|
251
|
+
end
|
252
|
+
|
253
|
+
it "fails when ruby version doesn't match" do
|
254
|
+
install_gemfile <<-G
|
255
|
+
source "file://#{gem_repo1}"
|
256
|
+
gem "rack"
|
257
|
+
G
|
258
|
+
|
259
|
+
gemfile <<-G
|
260
|
+
source "file://#{gem_repo1}"
|
261
|
+
gem "rack"
|
262
|
+
|
263
|
+
#{ruby_version_incorrect}
|
264
|
+
G
|
265
|
+
|
266
|
+
bundle :check, :exitstatus => true
|
267
|
+
should_be_ruby_version_incorrect
|
268
|
+
end
|
269
|
+
|
270
|
+
it "fails when engine doesn't match" do
|
271
|
+
install_gemfile <<-G
|
272
|
+
source "file://#{gem_repo1}"
|
273
|
+
gem "rack"
|
274
|
+
G
|
275
|
+
|
276
|
+
gemfile <<-G
|
277
|
+
source "file://#{gem_repo1}"
|
278
|
+
gem "rack"
|
279
|
+
|
280
|
+
#{engine_incorrect}
|
281
|
+
G
|
282
|
+
|
283
|
+
bundle :check, :exitstatus => true
|
284
|
+
should_be_engine_incorrect
|
285
|
+
end
|
286
|
+
|
287
|
+
it "fails when engine version doesn't match" do
|
288
|
+
simulate_ruby_engine "ruby" do
|
289
|
+
install_gemfile <<-G
|
290
|
+
source "file://#{gem_repo1}"
|
291
|
+
gem "rack"
|
292
|
+
G
|
293
|
+
|
294
|
+
gemfile <<-G
|
295
|
+
source "file://#{gem_repo1}"
|
296
|
+
gem "rack"
|
297
|
+
|
298
|
+
#{engine_version_incorrect}
|
299
|
+
G
|
300
|
+
|
301
|
+
bundle :check, :exitstatus => true
|
302
|
+
should_be_engine_version_incorrect
|
303
|
+
end
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
context "bundle update" do
|
308
|
+
before do
|
309
|
+
build_repo2
|
310
|
+
|
311
|
+
install_gemfile <<-G
|
312
|
+
source "file://#{gem_repo2}"
|
313
|
+
gem "activesupport"
|
314
|
+
gem "rack-obama"
|
315
|
+
G
|
316
|
+
end
|
317
|
+
|
318
|
+
it "updates successfully when the ruby version matches" do
|
319
|
+
gemfile <<-G
|
320
|
+
source "file://#{gem_repo2}"
|
321
|
+
gem "activesupport"
|
322
|
+
gem "rack-obama"
|
323
|
+
|
324
|
+
#{ruby_version_correct}
|
325
|
+
G
|
326
|
+
update_repo2 do
|
327
|
+
build_gem "activesupport", "3.0"
|
328
|
+
end
|
329
|
+
|
330
|
+
bundle "update"
|
331
|
+
should_be_installed "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
|
332
|
+
end
|
333
|
+
|
334
|
+
it "fails when ruby version doesn't match" do
|
335
|
+
gemfile <<-G
|
336
|
+
source "file://#{gem_repo2}"
|
337
|
+
gem "activesupport"
|
338
|
+
gem "rack-obama"
|
339
|
+
|
340
|
+
#{ruby_version_incorrect}
|
341
|
+
G
|
342
|
+
update_repo2 do
|
343
|
+
build_gem "activesupport", "3.0"
|
344
|
+
end
|
345
|
+
|
346
|
+
bundle :update, :exitstatus => true
|
347
|
+
should_be_ruby_version_incorrect
|
348
|
+
end
|
349
|
+
|
350
|
+
it "fails when ruby engine doesn't match" do
|
351
|
+
gemfile <<-G
|
352
|
+
source "file://#{gem_repo2}"
|
353
|
+
gem "activesupport"
|
354
|
+
gem "rack-obama"
|
355
|
+
|
356
|
+
#{engine_incorrect}
|
357
|
+
G
|
358
|
+
update_repo2 do
|
359
|
+
build_gem "activesupport", "3.0"
|
360
|
+
end
|
361
|
+
|
362
|
+
bundle :update, :exitstatus => true
|
363
|
+
should_be_engine_incorrect
|
364
|
+
end
|
365
|
+
|
366
|
+
it "fails when ruby engine version doesn't match" do
|
367
|
+
simulate_ruby_engine "jruby" do
|
368
|
+
gemfile <<-G
|
369
|
+
source "file://#{gem_repo2}"
|
370
|
+
gem "activesupport"
|
371
|
+
gem "rack-obama"
|
372
|
+
|
373
|
+
#{engine_version_incorrect}
|
374
|
+
G
|
375
|
+
update_repo2 do
|
376
|
+
build_gem "activesupport", "3.0"
|
377
|
+
end
|
378
|
+
|
379
|
+
bundle :update, :exitstatus => true
|
380
|
+
should_be_engine_version_incorrect
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
context "bundle show" do
|
386
|
+
before do
|
387
|
+
install_gemfile <<-G
|
388
|
+
source "file://#{gem_repo1}"
|
389
|
+
gem "rails"
|
390
|
+
G
|
391
|
+
end
|
392
|
+
|
393
|
+
it "prints path if ruby version is correct" do
|
394
|
+
gemfile <<-G
|
395
|
+
source "file://#{gem_repo1}"
|
396
|
+
gem "rails"
|
397
|
+
|
398
|
+
#{ruby_version_correct}
|
399
|
+
G
|
400
|
+
|
401
|
+
bundle "show rails"
|
402
|
+
out.should == default_bundle_path('gems', 'rails-2.3.2').to_s
|
403
|
+
end
|
404
|
+
|
405
|
+
it "fails if ruby version doesn't match" do
|
406
|
+
gemfile <<-G
|
407
|
+
source "file://#{gem_repo1}"
|
408
|
+
gem "rails"
|
409
|
+
|
410
|
+
#{ruby_version_incorrect}
|
411
|
+
G
|
412
|
+
|
413
|
+
bundle "show rails", :exitstatus => true
|
414
|
+
should_be_ruby_version_incorrect
|
415
|
+
end
|
416
|
+
|
417
|
+
it "fails if engine doesn't match" do
|
418
|
+
gemfile <<-G
|
419
|
+
source "file://#{gem_repo1}"
|
420
|
+
gem "rails"
|
421
|
+
|
422
|
+
#{engine_incorrect}
|
423
|
+
G
|
424
|
+
|
425
|
+
bundle "show rails", :exitstatus => true
|
426
|
+
should_be_engine_incorrect
|
427
|
+
end
|
428
|
+
|
429
|
+
it "fails if engine version doesn't match" do
|
430
|
+
simulate_ruby_engine "jruby" do
|
431
|
+
gemfile <<-G
|
432
|
+
source "file://#{gem_repo1}"
|
433
|
+
gem "rails"
|
434
|
+
|
435
|
+
#{engine_version_incorrect}
|
436
|
+
G
|
437
|
+
|
438
|
+
bundle "show rails", :exitstatus => true
|
439
|
+
should_be_engine_version_incorrect
|
440
|
+
end
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
context "bundle cache" do
|
445
|
+
before do
|
446
|
+
gemfile <<-G
|
447
|
+
gem 'rack'
|
448
|
+
G
|
449
|
+
|
450
|
+
system_gems "rack-1.0.0"
|
451
|
+
end
|
452
|
+
|
453
|
+
it "copies the .gem file to vendor/cache when ruby version matches" do
|
454
|
+
gemfile <<-G
|
455
|
+
gem 'rack'
|
456
|
+
|
457
|
+
#{ruby_version_correct}
|
458
|
+
G
|
459
|
+
|
460
|
+
bundle :cache
|
461
|
+
bundled_app("vendor/cache/rack-1.0.0.gem").should exist
|
462
|
+
end
|
463
|
+
|
464
|
+
it "fails if the ruby version doesn't match" do
|
465
|
+
gemfile <<-G
|
466
|
+
gem 'rack'
|
467
|
+
|
468
|
+
#{ruby_version_incorrect}
|
469
|
+
G
|
470
|
+
|
471
|
+
bundle :cache, :exitstatus => true
|
472
|
+
should_be_ruby_version_incorrect
|
473
|
+
end
|
474
|
+
|
475
|
+
it "fails if the engine doesn't match" do
|
476
|
+
gemfile <<-G
|
477
|
+
gem 'rack'
|
478
|
+
|
479
|
+
#{engine_incorrect}
|
480
|
+
G
|
481
|
+
|
482
|
+
bundle :cache, :exitstatus => true
|
483
|
+
should_be_engine_incorrect
|
484
|
+
end
|
485
|
+
|
486
|
+
it "fails if the engine version doesn't match" do
|
487
|
+
simulate_ruby_engine "jruby" do
|
488
|
+
gemfile <<-G
|
489
|
+
gem 'rack'
|
490
|
+
|
491
|
+
#{engine_version_incorrect}
|
492
|
+
G
|
493
|
+
|
494
|
+
bundle :cache, :exitstatus => true
|
495
|
+
should_be_engine_version_incorrect
|
496
|
+
end
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
context "bundle pack" do
|
501
|
+
before do
|
502
|
+
gemfile <<-G
|
503
|
+
gem 'rack'
|
504
|
+
G
|
505
|
+
|
506
|
+
system_gems "rack-1.0.0"
|
507
|
+
end
|
508
|
+
|
509
|
+
it "copies the .gem file to vendor/cache when ruby version matches" do
|
510
|
+
gemfile <<-G
|
511
|
+
gem 'rack'
|
512
|
+
|
513
|
+
#{ruby_version_correct}
|
514
|
+
G
|
515
|
+
|
516
|
+
bundle :pack
|
517
|
+
bundled_app("vendor/cache/rack-1.0.0.gem").should exist
|
518
|
+
end
|
519
|
+
|
520
|
+
it "fails if the ruby version doesn't match" do
|
521
|
+
gemfile <<-G
|
522
|
+
gem 'rack'
|
523
|
+
|
524
|
+
#{ruby_version_incorrect}
|
525
|
+
G
|
526
|
+
|
527
|
+
bundle :pack, :exitstatus => true
|
528
|
+
should_be_ruby_version_incorrect
|
529
|
+
end
|
530
|
+
|
531
|
+
it "fails if the engine doesn't match" do
|
532
|
+
gemfile <<-G
|
533
|
+
gem 'rack'
|
534
|
+
|
535
|
+
#{engine_incorrect}
|
536
|
+
G
|
537
|
+
|
538
|
+
bundle :pack, :exitstatus => true
|
539
|
+
should_be_engine_incorrect
|
540
|
+
end
|
541
|
+
|
542
|
+
it "fails if the engine version doesn't match" do
|
543
|
+
simulate_ruby_engine "jruby" do
|
544
|
+
gemfile <<-G
|
545
|
+
gem 'rack'
|
546
|
+
|
547
|
+
#{engine_version_incorrect}
|
548
|
+
G
|
549
|
+
|
550
|
+
bundle :pack, :exitstatus => true
|
551
|
+
should_be_engine_version_incorrect
|
552
|
+
end
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
context "bundle exec" do
|
557
|
+
before do
|
558
|
+
system_gems "rack-1.0.0", "rack-0.9.1"
|
559
|
+
end
|
560
|
+
|
561
|
+
it "activates the correct gem when ruby version matches" do
|
562
|
+
gemfile <<-G
|
563
|
+
gem "rack", "0.9.1"
|
564
|
+
|
565
|
+
#{ruby_version_correct}
|
566
|
+
G
|
567
|
+
|
568
|
+
bundle "exec rackup"
|
569
|
+
out.should == "0.9.1"
|
570
|
+
end
|
571
|
+
|
572
|
+
it "fails when the ruby version doesn't match" do
|
573
|
+
gemfile <<-G
|
574
|
+
gem "rack", "0.9.1"
|
575
|
+
|
576
|
+
#{ruby_version_incorrect}
|
577
|
+
G
|
578
|
+
|
579
|
+
bundle "exec rackup", :exitstatus => true
|
580
|
+
should_be_ruby_version_incorrect
|
581
|
+
end
|
582
|
+
|
583
|
+
it "fails when the engine doesn't match" do
|
584
|
+
gemfile <<-G
|
585
|
+
gem "rack", "0.9.1"
|
586
|
+
|
587
|
+
#{engine_incorrect}
|
588
|
+
G
|
589
|
+
|
590
|
+
bundle "exec rackup", :exitstatus => true
|
591
|
+
should_be_engine_incorrect
|
592
|
+
end
|
593
|
+
|
594
|
+
it "fails when the engine version doesn't match" do
|
595
|
+
simulate_ruby_engine "jruby" do
|
596
|
+
gemfile <<-G
|
597
|
+
gem "rack", "0.9.1"
|
598
|
+
|
599
|
+
#{engine_version_incorrect}
|
600
|
+
G
|
601
|
+
|
602
|
+
bundle "exec rackup", :exitstatus => true
|
603
|
+
should_be_engine_version_incorrect
|
604
|
+
end
|
605
|
+
end
|
606
|
+
end
|
607
|
+
|
608
|
+
context "bundle console" do
|
609
|
+
before do
|
610
|
+
install_gemfile <<-G
|
611
|
+
source "file://#{gem_repo1}"
|
612
|
+
gem "rack"
|
613
|
+
gem "activesupport", :group => :test
|
614
|
+
gem "rack_middleware", :group => :development
|
615
|
+
G
|
616
|
+
end
|
617
|
+
|
618
|
+
it "starts IRB with the default group loaded when ruby version matches" do
|
619
|
+
gemfile <<-G
|
620
|
+
source "file://#{gem_repo1}"
|
621
|
+
gem "rack"
|
622
|
+
gem "activesupport", :group => :test
|
623
|
+
gem "rack_middleware", :group => :development
|
624
|
+
|
625
|
+
#{ruby_version_correct}
|
626
|
+
G
|
627
|
+
|
628
|
+
bundle "console" do |input|
|
629
|
+
input.puts("puts RACK")
|
630
|
+
input.puts("exit")
|
631
|
+
end
|
632
|
+
out.should include("0.9.1")
|
633
|
+
end
|
634
|
+
|
635
|
+
it "fails when ruby version doesn't match" do
|
636
|
+
gemfile <<-G
|
637
|
+
source "file://#{gem_repo1}"
|
638
|
+
gem "rack"
|
639
|
+
gem "activesupport", :group => :test
|
640
|
+
gem "rack_middleware", :group => :development
|
641
|
+
|
642
|
+
#{ruby_version_incorrect}
|
643
|
+
G
|
644
|
+
|
645
|
+
bundle "console", :exitstatus => true
|
646
|
+
should_be_ruby_version_incorrect
|
647
|
+
end
|
648
|
+
|
649
|
+
it "fails when engine doesn't match" do
|
650
|
+
gemfile <<-G
|
651
|
+
source "file://#{gem_repo1}"
|
652
|
+
gem "rack"
|
653
|
+
gem "activesupport", :group => :test
|
654
|
+
gem "rack_middleware", :group => :development
|
655
|
+
|
656
|
+
#{engine_incorrect}
|
657
|
+
G
|
658
|
+
|
659
|
+
bundle "console", :exitstatus => true
|
660
|
+
should_be_engine_incorrect
|
661
|
+
end
|
662
|
+
|
663
|
+
it "fails when engine version doesn't match" do
|
664
|
+
simulate_ruby_engine "jruby" do
|
665
|
+
gemfile <<-G
|
666
|
+
source "file://#{gem_repo1}"
|
667
|
+
gem "rack"
|
668
|
+
gem "activesupport", :group => :test
|
669
|
+
gem "rack_middleware", :group => :development
|
670
|
+
|
671
|
+
#{engine_version_incorrect}
|
672
|
+
G
|
673
|
+
|
674
|
+
bundle "console", :exitstatus => true
|
675
|
+
should_be_engine_version_incorrect
|
676
|
+
end
|
677
|
+
end
|
678
|
+
end
|
679
|
+
|
680
|
+
context "Bundler.setup" do
|
681
|
+
before do
|
682
|
+
install_gemfile <<-G
|
683
|
+
source "file://#{gem_repo1}"
|
684
|
+
gem "yard"
|
685
|
+
gem "rack", :group => :test
|
686
|
+
G
|
687
|
+
end
|
688
|
+
|
689
|
+
it "makes a Gemfile.lock if setup succeeds" do
|
690
|
+
install_gemfile <<-G
|
691
|
+
source "file://#{gem_repo1}"
|
692
|
+
gem "yard"
|
693
|
+
gem "rack"
|
694
|
+
|
695
|
+
#{ruby_version_correct}
|
696
|
+
G
|
697
|
+
|
698
|
+
File.read(bundled_app("Gemfile.lock"))
|
699
|
+
|
700
|
+
FileUtils.rm(bundled_app("Gemfile.lock"))
|
701
|
+
|
702
|
+
run "1"
|
703
|
+
bundled_app("Gemfile.lock").should exist
|
704
|
+
end
|
705
|
+
|
706
|
+
it "fails when ruby version doesn't match" do
|
707
|
+
install_gemfile <<-G
|
708
|
+
source "file://#{gem_repo1}"
|
709
|
+
gem "yard"
|
710
|
+
gem "rack"
|
711
|
+
|
712
|
+
#{ruby_version_incorrect}
|
713
|
+
G
|
714
|
+
|
715
|
+
File.read(bundled_app("Gemfile.lock"))
|
716
|
+
|
717
|
+
FileUtils.rm(bundled_app("Gemfile.lock"))
|
718
|
+
|
719
|
+
ruby <<-R
|
720
|
+
require 'rubygems'
|
721
|
+
require 'bundler'
|
722
|
+
|
723
|
+
begin
|
724
|
+
Bundler.setup
|
725
|
+
rescue Bundler::RubyVersionMismatch => e
|
726
|
+
puts e.message
|
727
|
+
end
|
728
|
+
R
|
729
|
+
|
730
|
+
bundled_app("Gemfile.lock").should_not exist
|
731
|
+
should_be_ruby_version_incorrect(:exitstatus => false)
|
732
|
+
end
|
733
|
+
|
734
|
+
it "fails when engine doesn't match" do
|
735
|
+
install_gemfile <<-G
|
736
|
+
source "file://#{gem_repo1}"
|
737
|
+
gem "yard"
|
738
|
+
gem "rack"
|
739
|
+
|
740
|
+
#{engine_incorrect}
|
741
|
+
G
|
742
|
+
|
743
|
+
File.read(bundled_app("Gemfile.lock"))
|
744
|
+
|
745
|
+
FileUtils.rm(bundled_app("Gemfile.lock"))
|
746
|
+
|
747
|
+
ruby <<-R
|
748
|
+
require 'rubygems'
|
749
|
+
require 'bundler'
|
750
|
+
|
751
|
+
begin
|
752
|
+
Bundler.setup
|
753
|
+
rescue Bundler::RubyVersionMismatch => e
|
754
|
+
puts e.message
|
755
|
+
end
|
756
|
+
R
|
757
|
+
|
758
|
+
bundled_app("Gemfile.lock").should_not exist
|
759
|
+
should_be_engine_incorrect(:exitstatus => false)
|
760
|
+
end
|
761
|
+
|
762
|
+
it "fails when engine version doesn't match" do
|
763
|
+
simulate_ruby_engine "jruby" do
|
764
|
+
install_gemfile <<-G
|
765
|
+
source "file://#{gem_repo1}"
|
766
|
+
gem "yard"
|
767
|
+
gem "rack"
|
768
|
+
|
769
|
+
#{engine_version_incorrect}
|
770
|
+
G
|
771
|
+
|
772
|
+
File.read(bundled_app("Gemfile.lock"))
|
773
|
+
|
774
|
+
FileUtils.rm(bundled_app("Gemfile.lock"))
|
775
|
+
|
776
|
+
ruby <<-R
|
777
|
+
require 'rubygems'
|
778
|
+
require 'bundler'
|
779
|
+
|
780
|
+
begin
|
781
|
+
Bundler.setup
|
782
|
+
rescue Bundler::RubyVersionMismatch => e
|
783
|
+
puts e.message
|
784
|
+
end
|
785
|
+
R
|
786
|
+
|
787
|
+
bundled_app("Gemfile.lock").should_not exist
|
788
|
+
should_be_engine_version_incorrect(:exitstatus => false)
|
789
|
+
end
|
790
|
+
end
|
791
|
+
end
|
792
|
+
|
793
|
+
context "bundle outdated" do
|
794
|
+
before do
|
795
|
+
build_repo2 do
|
796
|
+
build_git "foo", :path => lib_path("foo")
|
797
|
+
end
|
798
|
+
|
799
|
+
install_gemfile <<-G
|
800
|
+
source "file://#{gem_repo2}"
|
801
|
+
gem "activesupport", "2.3.5"
|
802
|
+
gem "foo", :git => "#{lib_path('foo')}"
|
803
|
+
G
|
804
|
+
end
|
805
|
+
|
806
|
+
it "returns list of outdated gems when the ruby version matches" do
|
807
|
+
update_repo2 do
|
808
|
+
build_gem "activesupport", "3.0"
|
809
|
+
update_git "foo", :path => lib_path("foo")
|
810
|
+
end
|
811
|
+
|
812
|
+
gemfile <<-G
|
813
|
+
source "file://#{gem_repo2}"
|
814
|
+
gem "activesupport", "2.3.5"
|
815
|
+
gem "foo", :git => "#{lib_path('foo')}"
|
816
|
+
|
817
|
+
#{ruby_version_correct}
|
818
|
+
G
|
819
|
+
|
820
|
+
bundle "outdated"
|
821
|
+
out.should include("activesupport (3.0 > 2.3.5)")
|
822
|
+
out.should include("foo (1.0")
|
823
|
+
end
|
824
|
+
|
825
|
+
it "fails when the ruby version doesn't match" do
|
826
|
+
update_repo2 do
|
827
|
+
build_gem "activesupport", "3.0"
|
828
|
+
update_git "foo", :path => lib_path("foo")
|
829
|
+
end
|
830
|
+
|
831
|
+
gemfile <<-G
|
832
|
+
source "file://#{gem_repo2}"
|
833
|
+
gem "activesupport", "2.3.5"
|
834
|
+
gem "foo", :git => "#{lib_path('foo')}"
|
835
|
+
|
836
|
+
#{ruby_version_incorrect}
|
837
|
+
G
|
838
|
+
|
839
|
+
bundle "outdated", :exitstatus => true
|
840
|
+
should_be_ruby_version_incorrect
|
841
|
+
end
|
842
|
+
|
843
|
+
it "fails when the engine doesn't match" do
|
844
|
+
update_repo2 do
|
845
|
+
build_gem "activesupport", "3.0"
|
846
|
+
update_git "foo", :path => lib_path("foo")
|
847
|
+
end
|
848
|
+
|
849
|
+
gemfile <<-G
|
850
|
+
source "file://#{gem_repo2}"
|
851
|
+
gem "activesupport", "2.3.5"
|
852
|
+
gem "foo", :git => "#{lib_path('foo')}"
|
853
|
+
|
854
|
+
#{engine_incorrect}
|
855
|
+
G
|
856
|
+
|
857
|
+
bundle "outdated", :exitstatus => true
|
858
|
+
should_be_engine_incorrect
|
859
|
+
end
|
860
|
+
|
861
|
+
it "fails when the engine version doesn't match" do
|
862
|
+
simulate_ruby_engine "jruby" do
|
863
|
+
update_repo2 do
|
864
|
+
build_gem "activesupport", "3.0"
|
865
|
+
update_git "foo", :path => lib_path("foo")
|
866
|
+
end
|
867
|
+
|
868
|
+
gemfile <<-G
|
869
|
+
source "file://#{gem_repo2}"
|
870
|
+
gem "activesupport", "2.3.5"
|
871
|
+
gem "foo", :git => "#{lib_path('foo')}"
|
872
|
+
|
873
|
+
#{engine_version_incorrect}
|
874
|
+
G
|
875
|
+
|
876
|
+
bundle "outdated", :exitstatus => true
|
877
|
+
should_be_engine_version_incorrect
|
878
|
+
end
|
879
|
+
end
|
880
|
+
end
|
881
|
+
end
|