bundler 1.2.5 → 1.3.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/.gitignore +10 -7
- data/.travis.yml +12 -3
- data/CHANGELOG.md +26 -19
- data/CONTRIBUTE.md +97 -0
- data/README.md +4 -2
- data/Rakefile +17 -59
- data/bundler.gemspec +2 -1
- data/lib/bundler.rb +23 -20
- data/lib/bundler/cli.rb +68 -22
- data/lib/bundler/definition.rb +3 -2
- data/lib/bundler/deprecate.rb +15 -0
- data/lib/bundler/dsl.rb +14 -16
- data/lib/bundler/environment.rb +0 -5
- data/lib/bundler/fetcher.rb +23 -78
- data/lib/bundler/friendly_errors.rb +4 -5
- data/lib/bundler/gem_helper.rb +14 -16
- data/lib/bundler/injector.rb +64 -0
- data/lib/bundler/installer.rb +1 -7
- data/lib/bundler/lazy_specification.rb +6 -3
- data/lib/bundler/lockfile_parser.rb +25 -13
- data/lib/bundler/resolver.rb +0 -1
- data/lib/bundler/rubygems_integration.rb +83 -17
- data/lib/bundler/settings.rb +4 -2
- data/lib/bundler/similarity_detector.rb +63 -0
- data/lib/bundler/source.rb +3 -886
- data/lib/bundler/source/git.rb +267 -0
- data/lib/bundler/source/git/git_proxy.rb +142 -0
- data/lib/bundler/source/path.rb +209 -0
- data/lib/bundler/source/path/installer.rb +33 -0
- data/lib/bundler/source/rubygems.rb +261 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -0
- data/lib/bundler/templates/newgem/rspec.tt +2 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +9 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/lib/bundler/templates/newgem/test/minitest_helper.rb.tt +4 -0
- data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +11 -0
- data/lib/bundler/ui.rb +20 -5
- data/lib/bundler/vendor/.document +0 -0
- data/lib/bundler/vendor/thor.rb +74 -5
- data/lib/bundler/vendor/thor/actions.rb +5 -5
- data/lib/bundler/vendor/thor/actions/directory.rb +1 -0
- data/lib/bundler/vendor/thor/actions/file_manipulation.rb +7 -1
- data/lib/bundler/vendor/thor/base.rb +44 -11
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rb +5 -0
- data/lib/bundler/vendor/thor/parser/argument.rb +14 -7
- data/lib/bundler/vendor/thor/parser/arguments.rb +7 -1
- data/lib/bundler/vendor/thor/parser/option.rb +8 -8
- data/lib/bundler/vendor/thor/parser/options.rb +62 -24
- data/lib/bundler/vendor/thor/runner.rb +1 -1
- data/lib/bundler/vendor/thor/shell/basic.rb +2 -2
- data/lib/bundler/vendor/thor/task.rb +2 -2
- data/lib/bundler/vendor/thor/version.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +3 -15
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-exec.ronn +1 -1
- data/man/bundle-update.ronn +1 -1
- data/man/bundle.ronn +4 -1
- data/spec/bundler/bundler_spec.rb +2 -28
- data/spec/bundler/cli_rspec.rb +9 -0
- data/spec/bundler/definition_spec.rb +1 -1
- data/spec/bundler/dsl_spec.rb +15 -8
- data/spec/bundler/gem_helper_spec.rb +38 -21
- data/spec/bundler/psyched_yaml_spec.rb +1 -0
- data/spec/bundler/source_spec.rb +3 -3
- data/spec/cache/gems_spec.rb +24 -24
- data/spec/cache/git_spec.rb +21 -23
- data/spec/cache/path_spec.rb +11 -11
- data/spec/cache/platform_spec.rb +6 -6
- data/spec/install/deploy_spec.rb +38 -38
- data/spec/install/gems/c_ext_spec.rb +2 -2
- data/spec/install/gems/dependency_api_spec.rb +23 -116
- data/spec/install/gems/env_spec.rb +1 -1
- data/spec/install/gems/flex_spec.rb +7 -8
- data/spec/install/gems/groups_spec.rb +10 -10
- data/spec/install/gems/packed_spec.rb +4 -4
- data/spec/install/gems/platform_spec.rb +3 -3
- data/spec/install/gems/post_install_spec.rb +9 -9
- data/spec/install/gems/resolving_spec.rb +2 -2
- data/spec/install/gems/simple_case_spec.rb +50 -53
- data/spec/install/gems/standalone_spec.rb +19 -19
- data/spec/install/gems/sudo_spec.rb +31 -16
- data/spec/install/gems/win32_spec.rb +1 -1
- data/spec/install/gemspec_spec.rb +6 -6
- data/spec/install/git_spec.rb +34 -34
- data/spec/install/invalid_spec.rb +3 -3
- data/spec/install/path_spec.rb +71 -8
- data/spec/install/upgrade_spec.rb +2 -2
- data/spec/integration/inject.rb +78 -0
- data/spec/lock/git_spec.rb +2 -2
- data/spec/lock/lockfile_spec.rb +14 -14
- data/spec/other/check_spec.rb +29 -29
- data/spec/other/clean_spec.rb +47 -48
- data/spec/other/config_spec.rb +20 -20
- data/spec/other/console_spec.rb +5 -5
- data/spec/other/exec_spec.rb +48 -28
- data/spec/other/ext_spec.rb +3 -3
- data/spec/other/help_spec.rb +6 -6
- data/spec/other/init_spec.rb +8 -8
- data/spec/other/newgem_spec.rb +95 -15
- data/spec/other/open_spec.rb +10 -5
- data/spec/other/outdated_spec.rb +8 -8
- data/spec/other/platform_spec.rb +45 -45
- data/spec/other/show_spec.rb +10 -10
- data/spec/quality_spec.rb +2 -2
- data/spec/realworld/dependency_api_spec.rb +61 -0
- data/spec/realworld/edgecases_spec.rb +8 -8
- data/spec/runtime/executable_spec.rb +13 -13
- data/spec/runtime/load_spec.rb +12 -12
- data/spec/runtime/platform_spec.rb +1 -1
- data/spec/runtime/require_spec.rb +24 -24
- data/spec/runtime/setup_spec.rb +113 -56
- data/spec/runtime/with_clean_env_spec.rb +11 -13
- data/spec/spec_helper.rb +6 -0
- data/spec/support/artifice/endpoint.rb +28 -13
- data/spec/support/artifice/endpoint_extra.rb +4 -0
- data/spec/support/builders.rb +1 -1
- data/spec/support/helpers.rb +2 -7
- data/spec/support/indexes.rb +3 -3
- data/spec/support/matchers.rb +6 -6
- data/spec/update/gems_spec.rb +19 -8
- data/spec/update/git_spec.rb +10 -10
- data/spec/update/source_spec.rb +1 -1
- metadata +86 -55
- data/.rspec +0 -2
data/spec/other/clean_spec.rb
CHANGED
@@ -3,17 +3,17 @@ require "spec_helper"
|
|
3
3
|
describe "bundle clean" do
|
4
4
|
def should_have_gems(*gems)
|
5
5
|
gems.each do |g|
|
6
|
-
vendored_gems("gems/#{g}").
|
7
|
-
vendored_gems("specifications/#{g}.gemspec").
|
8
|
-
vendored_gems("cache/#{g}.gem").
|
6
|
+
expect(vendored_gems("gems/#{g}")).to exist
|
7
|
+
expect(vendored_gems("specifications/#{g}.gemspec")).to exist
|
8
|
+
expect(vendored_gems("cache/#{g}.gem")).to exist
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def should_not_have_gems(*gems)
|
13
13
|
gems.each do |g|
|
14
|
-
vendored_gems("gems/#{g}").
|
15
|
-
vendored_gems("specifications/#{g}.gemspec").
|
16
|
-
vendored_gems("cache/#{g}.gem").
|
14
|
+
expect(vendored_gems("gems/#{g}")).not_to exist
|
15
|
+
expect(vendored_gems("specifications/#{g}.gemspec")).not_to exist
|
16
|
+
expect(vendored_gems("cache/#{g}.gem")).not_to exist
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -36,12 +36,12 @@ describe "bundle clean" do
|
|
36
36
|
|
37
37
|
bundle :clean
|
38
38
|
|
39
|
-
out.
|
39
|
+
expect(out).to eq("Removing foo (1.0)")
|
40
40
|
|
41
41
|
should_have_gems 'thin-1.0', 'rack-1.0.0'
|
42
42
|
should_not_have_gems 'foo-1.0'
|
43
43
|
|
44
|
-
vendored_gems("bin/rackup").
|
44
|
+
expect(vendored_gems("bin/rackup")).to exist
|
45
45
|
end
|
46
46
|
|
47
47
|
it "removes old version of gem if unused" do
|
@@ -64,12 +64,12 @@ describe "bundle clean" do
|
|
64
64
|
|
65
65
|
bundle :clean
|
66
66
|
|
67
|
-
out.
|
67
|
+
expect(out).to eq("Removing rack (0.9.1)")
|
68
68
|
|
69
69
|
should_have_gems 'foo-1.0', 'rack-1.0.0'
|
70
70
|
should_not_have_gems 'rack-0.9.1'
|
71
71
|
|
72
|
-
vendored_gems("bin/rackup").
|
72
|
+
expect(vendored_gems("bin/rackup")).to exist
|
73
73
|
end
|
74
74
|
|
75
75
|
it "removes new version of gem if unused" do
|
@@ -92,12 +92,12 @@ describe "bundle clean" do
|
|
92
92
|
|
93
93
|
bundle :clean
|
94
94
|
|
95
|
-
out.
|
95
|
+
expect(out).to eq("Removing rack (1.0.0)")
|
96
96
|
|
97
97
|
should_have_gems 'foo-1.0', 'rack-0.9.1'
|
98
98
|
should_not_have_gems 'rack-1.0.0'
|
99
99
|
|
100
|
-
vendored_gems("bin/rackup").
|
100
|
+
expect(vendored_gems("bin/rackup")).to exist
|
101
101
|
end
|
102
102
|
|
103
103
|
it "remove gems in bundle without groups" do
|
@@ -115,12 +115,12 @@ describe "bundle clean" do
|
|
115
115
|
bundle "install --without test_group"
|
116
116
|
bundle :clean
|
117
117
|
|
118
|
-
out.
|
118
|
+
expect(out).to eq("Removing rack (1.0.0)")
|
119
119
|
|
120
120
|
should_have_gems 'foo-1.0'
|
121
121
|
should_not_have_gems 'rack-1.0.0'
|
122
122
|
|
123
|
-
vendored_gems("bin/rackup").
|
123
|
+
expect(vendored_gems("bin/rackup")).to_not exist
|
124
124
|
end
|
125
125
|
|
126
126
|
it "does not remove cached git dir if it's being used" do
|
@@ -142,7 +142,7 @@ describe "bundle clean" do
|
|
142
142
|
bundle :clean
|
143
143
|
|
144
144
|
digest = Digest::SHA1.hexdigest(git_path.to_s)
|
145
|
-
vendored_gems("cache/bundler/git/foo-1.0-#{digest}").
|
145
|
+
expect(vendored_gems("cache/bundler/git/foo-1.0-#{digest}")).to exist
|
146
146
|
end
|
147
147
|
|
148
148
|
it "removes unused git gems" do
|
@@ -170,16 +170,16 @@ describe "bundle clean" do
|
|
170
170
|
|
171
171
|
bundle :clean
|
172
172
|
|
173
|
-
out.
|
173
|
+
expect(out).to eq("Removing foo (#{revision[0..11]})")
|
174
174
|
|
175
|
-
vendored_gems("gems/rack-1.0.0").
|
176
|
-
vendored_gems("bundler/gems/foo-#{revision[0..11]}").
|
175
|
+
expect(vendored_gems("gems/rack-1.0.0")).to exist
|
176
|
+
expect(vendored_gems("bundler/gems/foo-#{revision[0..11]}")).not_to exist
|
177
177
|
digest = Digest::SHA1.hexdigest(git_path.to_s)
|
178
|
-
vendored_gems("cache/bundler/git/foo-#{digest}").
|
178
|
+
expect(vendored_gems("cache/bundler/git/foo-#{digest}")).not_to exist
|
179
179
|
|
180
|
-
vendored_gems("specifications/rack-1.0.0.gemspec").
|
180
|
+
expect(vendored_gems("specifications/rack-1.0.0.gemspec")).to exist
|
181
181
|
|
182
|
-
vendored_gems("bin/rackup").
|
182
|
+
expect(vendored_gems("bin/rackup")).to exist
|
183
183
|
end
|
184
184
|
|
185
185
|
it "removes old git gems" do
|
@@ -203,15 +203,15 @@ describe "bundle clean" do
|
|
203
203
|
bundle "update"
|
204
204
|
bundle :clean
|
205
205
|
|
206
|
-
out.
|
206
|
+
expect(out).to eq("Removing foo-bar (#{revision[0..11]})")
|
207
207
|
|
208
|
-
vendored_gems("gems/rack-1.0.0").
|
209
|
-
vendored_gems("bundler/gems/foo-bar-#{revision[0..11]}").
|
210
|
-
vendored_gems("bundler/gems/foo-bar-#{revision2[0..11]}").
|
208
|
+
expect(vendored_gems("gems/rack-1.0.0")).to exist
|
209
|
+
expect(vendored_gems("bundler/gems/foo-bar-#{revision[0..11]}")).not_to exist
|
210
|
+
expect(vendored_gems("bundler/gems/foo-bar-#{revision2[0..11]}")).to exist
|
211
211
|
|
212
|
-
vendored_gems("specifications/rack-1.0.0.gemspec").
|
212
|
+
expect(vendored_gems("specifications/rack-1.0.0.gemspec")).to exist
|
213
213
|
|
214
|
-
vendored_gems("bin/rackup").
|
214
|
+
expect(vendored_gems("bin/rackup")).to exist
|
215
215
|
end
|
216
216
|
|
217
217
|
it "does not remove nested gems in a git repo" do
|
@@ -227,9 +227,9 @@ describe "bundle clean" do
|
|
227
227
|
|
228
228
|
bundle "install --path vendor/bundle"
|
229
229
|
bundle :clean
|
230
|
-
out.
|
230
|
+
expect(out).to eq("")
|
231
231
|
|
232
|
-
vendored_gems("bundler/gems/rails-#{revision[0..11]}").
|
232
|
+
expect(vendored_gems("bundler/gems/rails-#{revision[0..11]}")).to exist
|
233
233
|
end
|
234
234
|
|
235
235
|
it "does not remove git sources that are in without groups" do
|
@@ -251,10 +251,10 @@ describe "bundle clean" do
|
|
251
251
|
|
252
252
|
bundle :clean
|
253
253
|
|
254
|
-
out.
|
255
|
-
vendored_gems("bundler/gems/foo-#{revision[0..11]}").
|
254
|
+
expect(out).to eq("")
|
255
|
+
expect(vendored_gems("bundler/gems/foo-#{revision[0..11]}")).to exist
|
256
256
|
digest = Digest::SHA1.hexdigest(git_path.to_s)
|
257
|
-
vendored_gems("cache/bundler/git/foo-#{digest}").
|
257
|
+
expect(vendored_gems("cache/bundler/git/foo-#{digest}")).to_not exist
|
258
258
|
end
|
259
259
|
|
260
260
|
it "does not blow up when using without groups" do
|
@@ -271,10 +271,9 @@ describe "bundle clean" do
|
|
271
271
|
bundle "install --path vendor/bundle --without development"
|
272
272
|
|
273
273
|
bundle :clean, :exitstatus => true
|
274
|
-
exitstatus.
|
274
|
+
expect(exitstatus).to eq(0)
|
275
275
|
end
|
276
276
|
|
277
|
-
|
278
277
|
it "displays an error when used without --path" do
|
279
278
|
install_gemfile <<-G
|
280
279
|
source "file://#{gem_repo1}"
|
@@ -284,8 +283,8 @@ describe "bundle clean" do
|
|
284
283
|
|
285
284
|
bundle :clean, :exitstatus => true
|
286
285
|
|
287
|
-
exitstatus.
|
288
|
-
out.
|
286
|
+
expect(exitstatus).to eq(1)
|
287
|
+
expect(out).to eq("Can only use bundle clean when --path is set or --force is set")
|
289
288
|
end
|
290
289
|
|
291
290
|
# handling bundle clean upgrade path from the pre's
|
@@ -315,7 +314,7 @@ describe "bundle clean" do
|
|
315
314
|
should_not_have_gems 'thin-1.0', 'rack-1.0'
|
316
315
|
should_have_gems 'foo-1.0'
|
317
316
|
|
318
|
-
vendored_gems("bin/rackup").
|
317
|
+
expect(vendored_gems("bin/rackup")).not_to exist
|
319
318
|
end
|
320
319
|
|
321
320
|
it "does not call clean automatically when using system gems" do
|
@@ -335,8 +334,8 @@ describe "bundle clean" do
|
|
335
334
|
bundle :install
|
336
335
|
|
337
336
|
sys_exec "gem list"
|
338
|
-
out.
|
339
|
-
out.
|
337
|
+
expect(out).to include("rack (1.0.0)")
|
338
|
+
expect(out).to include("thin (1.0)")
|
340
339
|
end
|
341
340
|
|
342
341
|
it "--clean should override the bundle setting on install" do
|
@@ -432,7 +431,7 @@ describe "bundle clean" do
|
|
432
431
|
bundle :update
|
433
432
|
|
434
433
|
sys_exec "gem list"
|
435
|
-
out.
|
434
|
+
expect(out).to include("foo (1.0.1, 1.0)")
|
436
435
|
end
|
437
436
|
|
438
437
|
it "cleans system gems when --force is used" do
|
@@ -452,10 +451,10 @@ describe "bundle clean" do
|
|
452
451
|
bundle :install
|
453
452
|
bundle "clean --force"
|
454
453
|
|
455
|
-
out.
|
454
|
+
expect(out).to eq("Removing foo (1.0)")
|
456
455
|
sys_exec "gem list"
|
457
|
-
out.
|
458
|
-
out.
|
456
|
+
expect(out).not_to include("foo (1.0)")
|
457
|
+
expect(out).to include("rack (1.0.0)")
|
459
458
|
end
|
460
459
|
|
461
460
|
it "cleans git gems with a 7 length git revision" do
|
@@ -483,9 +482,9 @@ describe "bundle clean" do
|
|
483
482
|
|
484
483
|
bundle :clean
|
485
484
|
|
486
|
-
out.
|
485
|
+
expect(out).not_to include("Removing foo (1.0 #{revision[0..6]})")
|
487
486
|
|
488
|
-
vendored_gems("bundler/gems/foo-1.0-#{revision[0..6]}").
|
487
|
+
expect(vendored_gems("bundler/gems/foo-1.0-#{revision[0..6]}")).to exist
|
489
488
|
end
|
490
489
|
|
491
490
|
it "when using --force on system gems, it doesn't remove binaries" do
|
@@ -508,8 +507,8 @@ describe "bundle clean" do
|
|
508
507
|
|
509
508
|
sys_status "foo"
|
510
509
|
|
511
|
-
exitstatus.
|
512
|
-
out.
|
510
|
+
expect(exitstatus).to eq(0)
|
511
|
+
expect(out).to eq("1.0")
|
513
512
|
end
|
514
513
|
|
515
514
|
it "doesn't blow up on path gems without a .gempsec" do
|
@@ -530,6 +529,6 @@ describe "bundle clean" do
|
|
530
529
|
bundle "install --path vendor/bundle"
|
531
530
|
bundle :clean, :exitstatus => true
|
532
531
|
|
533
|
-
exitstatus.
|
532
|
+
expect(exitstatus).to eq(0)
|
534
533
|
end
|
535
534
|
end
|
data/spec/other/config_spec.rb
CHANGED
@@ -13,8 +13,8 @@ describe ".bundle/config" do
|
|
13
13
|
ENV['BUNDLE_APP_CONFIG'] = tmp('foo/bar').to_s
|
14
14
|
bundle "install --path vendor/bundle"
|
15
15
|
|
16
|
-
bundled_app('.bundle').
|
17
|
-
tmp('foo/bar/config').
|
16
|
+
expect(bundled_app('.bundle')).not_to exist
|
17
|
+
expect(tmp('foo/bar/config')).to exist
|
18
18
|
should_be_installed "rack 1.0.0"
|
19
19
|
end
|
20
20
|
|
@@ -25,8 +25,8 @@ describe ".bundle/config" do
|
|
25
25
|
ENV['BUNDLE_APP_CONFIG'] = "../foo"
|
26
26
|
bundle "install --path vendor/bundle"
|
27
27
|
|
28
|
-
bundled_app(".bundle").
|
29
|
-
bundled_app("../foo/config").
|
28
|
+
expect(bundled_app(".bundle")).not_to exist
|
29
|
+
expect(bundled_app("../foo/config")).to exist
|
30
30
|
should_be_installed "rack 1.0.0"
|
31
31
|
end
|
32
32
|
|
@@ -36,7 +36,7 @@ describe ".bundle/config" do
|
|
36
36
|
bundle "install"
|
37
37
|
FileUtils.touch tmp('foo/bar/environment.rb')
|
38
38
|
should_be_installed "rack 1.0.0"
|
39
|
-
tmp('foo/bar/environment.rb').
|
39
|
+
expect(tmp('foo/bar/environment.rb')).not_to exist
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -46,23 +46,23 @@ describe ".bundle/config" do
|
|
46
46
|
it "is the default" do
|
47
47
|
bundle "config foo global"
|
48
48
|
run "puts Bundler.settings[:foo]"
|
49
|
-
out.
|
49
|
+
expect(out).to eq("global")
|
50
50
|
end
|
51
51
|
|
52
52
|
it "can also be set explicitly" do
|
53
53
|
bundle "config --global foo global"
|
54
54
|
run "puts Bundler.settings[:foo]"
|
55
|
-
out.
|
55
|
+
expect(out).to eq("global")
|
56
56
|
end
|
57
57
|
|
58
58
|
it "has lower precedence than local" do
|
59
59
|
bundle "config --local foo local"
|
60
60
|
|
61
61
|
bundle "config --global foo global"
|
62
|
-
out.
|
62
|
+
expect(out).to match(/Your application has set foo to "local"/)
|
63
63
|
|
64
64
|
run "puts Bundler.settings[:foo]"
|
65
|
-
out.
|
65
|
+
expect(out).to eq("local")
|
66
66
|
end
|
67
67
|
|
68
68
|
it "has lower precedence than env" do
|
@@ -70,10 +70,10 @@ describe ".bundle/config" do
|
|
70
70
|
ENV["BUNDLE_FOO"] = "env"
|
71
71
|
|
72
72
|
bundle "config --global foo global"
|
73
|
-
out.
|
73
|
+
expect(out).to match(/You have a bundler environment variable for foo set to "env"/)
|
74
74
|
|
75
75
|
run "puts Bundler.settings[:foo]"
|
76
|
-
out.
|
76
|
+
expect(out).to eq("env")
|
77
77
|
ensure
|
78
78
|
ENV.delete("BUNDLE_FOO")
|
79
79
|
end
|
@@ -84,16 +84,16 @@ describe ".bundle/config" do
|
|
84
84
|
bundle "config --delete foo"
|
85
85
|
|
86
86
|
run "puts Bundler.settings[:foo] == nil"
|
87
|
-
out.
|
87
|
+
expect(out).to eq("true")
|
88
88
|
end
|
89
89
|
|
90
90
|
it "warns when overriding" do
|
91
91
|
bundle "config --global foo previous"
|
92
92
|
bundle "config --global foo global"
|
93
|
-
out.
|
93
|
+
expect(out).to match(/You are replacing the current global value of foo/)
|
94
94
|
|
95
95
|
run "puts Bundler.settings[:foo]"
|
96
|
-
out.
|
96
|
+
expect(out).to eq("global")
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -103,7 +103,7 @@ describe ".bundle/config" do
|
|
103
103
|
it "can also be set explicitly" do
|
104
104
|
bundle "config --local foo local"
|
105
105
|
run "puts Bundler.settings[:foo]"
|
106
|
-
out.
|
106
|
+
expect(out).to eq("local")
|
107
107
|
end
|
108
108
|
|
109
109
|
it "has higher precedence than env" do
|
@@ -112,7 +112,7 @@ describe ".bundle/config" do
|
|
112
112
|
bundle "config --local foo local"
|
113
113
|
|
114
114
|
run "puts Bundler.settings[:foo]"
|
115
|
-
out.
|
115
|
+
expect(out).to eq("local")
|
116
116
|
ensure
|
117
117
|
ENV.delete("BUNDLE_FOO")
|
118
118
|
end
|
@@ -123,16 +123,16 @@ describe ".bundle/config" do
|
|
123
123
|
bundle "config --delete foo"
|
124
124
|
|
125
125
|
run "puts Bundler.settings[:foo] == nil"
|
126
|
-
out.
|
126
|
+
expect(out).to eq("true")
|
127
127
|
end
|
128
128
|
|
129
129
|
it "warns when overriding" do
|
130
130
|
bundle "config --local foo previous"
|
131
131
|
bundle "config --local foo local"
|
132
|
-
out.
|
132
|
+
expect(out).to match(/You are replacing the current local value of foo/)
|
133
133
|
|
134
134
|
run "puts Bundler.settings[:foo]"
|
135
|
-
out.
|
135
|
+
expect(out).to eq("local")
|
136
136
|
end
|
137
137
|
end
|
138
|
-
end
|
138
|
+
end
|
data/spec/other/console_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe "bundle console" do
|
|
15
15
|
input.puts("puts RACK")
|
16
16
|
input.puts("exit")
|
17
17
|
end
|
18
|
-
out.
|
18
|
+
expect(out).to include("0.9.1")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "doesn't load any other groups" do
|
@@ -23,7 +23,7 @@ describe "bundle console" do
|
|
23
23
|
input.puts("puts ACTIVESUPPORT")
|
24
24
|
input.puts("exit")
|
25
25
|
end
|
26
|
-
out.
|
26
|
+
expect(out).to include("NameError")
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "when given a group" do
|
@@ -32,7 +32,7 @@ describe "bundle console" do
|
|
32
32
|
input.puts("puts ACTIVESUPPORT")
|
33
33
|
input.puts("exit")
|
34
34
|
end
|
35
|
-
out.
|
35
|
+
expect(out).to include("2.3.5")
|
36
36
|
end
|
37
37
|
|
38
38
|
it "loads the default group" do
|
@@ -40,7 +40,7 @@ describe "bundle console" do
|
|
40
40
|
input.puts("puts RACK")
|
41
41
|
input.puts("exit")
|
42
42
|
end
|
43
|
-
out.
|
43
|
+
expect(out).to include("0.9.1")
|
44
44
|
end
|
45
45
|
|
46
46
|
it "doesn't load other groups" do
|
@@ -48,7 +48,7 @@ describe "bundle console" do
|
|
48
48
|
input.puts("puts RACK_MIDDLEWARE")
|
49
49
|
input.puts("exit")
|
50
50
|
end
|
51
|
-
out.
|
51
|
+
expect(out).to include("NameError")
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/spec/other/exec_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe "bundle exec" do
|
|
11
11
|
G
|
12
12
|
|
13
13
|
bundle "exec rackup"
|
14
|
-
out.
|
14
|
+
expect(out).to eq("0.9.1")
|
15
15
|
end
|
16
16
|
|
17
17
|
it "works when the bins are in ~/.bundle" do
|
@@ -20,7 +20,7 @@ describe "bundle exec" do
|
|
20
20
|
G
|
21
21
|
|
22
22
|
bundle "exec rackup"
|
23
|
-
out.
|
23
|
+
expect(out).to eq("1.0.0")
|
24
24
|
end
|
25
25
|
|
26
26
|
it "works when running from a random directory" do
|
@@ -30,13 +30,37 @@ describe "bundle exec" do
|
|
30
30
|
|
31
31
|
bundle "exec 'cd #{tmp('gems')} && rackup'"
|
32
32
|
|
33
|
-
out.
|
33
|
+
expect(out).to eq("1.0.0")
|
34
34
|
end
|
35
35
|
|
36
36
|
it "works when exec'ing something else" do
|
37
37
|
install_gemfile 'gem "rack"'
|
38
38
|
bundle "exec echo exec"
|
39
|
-
out.
|
39
|
+
expect(out).to eq("exec")
|
40
|
+
end
|
41
|
+
|
42
|
+
it "accepts --verbose" do
|
43
|
+
install_gemfile 'gem "rack"'
|
44
|
+
bundle "exec --verbose echo foobar"
|
45
|
+
expect(out).to eq("foobar")
|
46
|
+
end
|
47
|
+
|
48
|
+
it "passes --verbose to command if it is given after the command" do
|
49
|
+
install_gemfile 'gem "rack"'
|
50
|
+
bundle "exec echo --verbose"
|
51
|
+
expect(out).to eq("--verbose")
|
52
|
+
end
|
53
|
+
|
54
|
+
it "can run a command named --verbose" do
|
55
|
+
install_gemfile 'gem "rack"'
|
56
|
+
File.open("--verbose", 'w') do |f|
|
57
|
+
f.puts "#!/bin/sh"
|
58
|
+
f.puts "echo foobar"
|
59
|
+
end
|
60
|
+
File.chmod(0744, "--verbose")
|
61
|
+
ENV['PATH'] = "."
|
62
|
+
bundle "exec -- --verbose"
|
63
|
+
expect(out).to eq("foobar")
|
40
64
|
end
|
41
65
|
|
42
66
|
it "handles different versions in different bundles" do
|
@@ -60,11 +84,11 @@ describe "bundle exec" do
|
|
60
84
|
|
61
85
|
bundle "exec rackup"
|
62
86
|
|
63
|
-
out.
|
87
|
+
expect(out).to eq("0.9.1")
|
64
88
|
|
65
89
|
Dir.chdir bundled_app2 do
|
66
90
|
bundle "exec rackup"
|
67
|
-
out.
|
91
|
+
expect(out).to eq("1.0.0")
|
68
92
|
end
|
69
93
|
end
|
70
94
|
|
@@ -80,7 +104,7 @@ describe "bundle exec" do
|
|
80
104
|
|
81
105
|
bundle "exec rackup"
|
82
106
|
|
83
|
-
out.
|
107
|
+
expect(out).to eq("0.9.1")
|
84
108
|
should_not_be_installed "rack_middleware 1.0"
|
85
109
|
end
|
86
110
|
|
@@ -93,10 +117,10 @@ describe "bundle exec" do
|
|
93
117
|
rubyopt = "-I#{bundler_path} -rbundler/setup #{rubyopt}"
|
94
118
|
|
95
119
|
bundle "exec 'echo $RUBYOPT'"
|
96
|
-
out.
|
120
|
+
expect(out).to have_rubyopts(rubyopt)
|
97
121
|
|
98
122
|
bundle "exec 'echo $RUBYOPT'", :env => {"RUBYOPT" => rubyopt}
|
99
|
-
out.
|
123
|
+
expect(out).to have_rubyopts(rubyopt)
|
100
124
|
end
|
101
125
|
|
102
126
|
it "errors nicely when the argument doesn't exist" do
|
@@ -105,9 +129,9 @@ describe "bundle exec" do
|
|
105
129
|
G
|
106
130
|
|
107
131
|
bundle "exec foobarbaz", :exitstatus => true
|
108
|
-
exitstatus.
|
109
|
-
out.
|
110
|
-
out.
|
132
|
+
expect(exitstatus).to eq(127)
|
133
|
+
expect(out).to include("bundler: command not found: foobarbaz")
|
134
|
+
expect(out).to include("Install missing gem executables with `bundle install`")
|
111
135
|
end
|
112
136
|
|
113
137
|
it "errors nicely when the argument is not executable" do
|
@@ -117,8 +141,8 @@ describe "bundle exec" do
|
|
117
141
|
|
118
142
|
bundle "exec touch foo"
|
119
143
|
bundle "exec ./foo", :exitstatus => true
|
120
|
-
exitstatus.
|
121
|
-
out.
|
144
|
+
expect(exitstatus).to eq(126)
|
145
|
+
expect(out).to include("bundler: not executable: ./foo")
|
122
146
|
end
|
123
147
|
|
124
148
|
it "errors nicely when no arguments are passed" do
|
@@ -127,8 +151,8 @@ describe "bundle exec" do
|
|
127
151
|
G
|
128
152
|
|
129
153
|
bundle "exec", :exitstatus => true
|
130
|
-
|
131
|
-
out.
|
154
|
+
expect(exitstatus).to eq(128)
|
155
|
+
expect(out).to include("bundler: exec needs a command to run")
|
132
156
|
end
|
133
157
|
|
134
158
|
describe "with gem executables" do
|
@@ -141,14 +165,13 @@ describe "bundle exec" do
|
|
141
165
|
|
142
166
|
it "works when unlocked" do
|
143
167
|
bundle "exec 'cd #{tmp('gems')} && rackup'"
|
144
|
-
out.
|
168
|
+
expect(out).to eq("1.0.0")
|
145
169
|
end
|
146
170
|
|
147
171
|
it "works when locked" do
|
148
|
-
bundle "lock"
|
149
172
|
should_be_locked
|
150
173
|
bundle "exec 'cd #{tmp('gems')} && rackup'"
|
151
|
-
out.
|
174
|
+
expect(out).to eq("1.0.0")
|
152
175
|
end
|
153
176
|
end
|
154
177
|
|
@@ -165,15 +188,14 @@ describe "bundle exec" do
|
|
165
188
|
|
166
189
|
it "works when unlocked" do
|
167
190
|
bundle "exec fizz"
|
168
|
-
out.
|
191
|
+
expect(out).to eq("1.0")
|
169
192
|
end
|
170
193
|
|
171
194
|
it "works when locked" do
|
172
|
-
bundle "lock"
|
173
195
|
should_be_locked
|
174
196
|
|
175
197
|
bundle "exec fizz"
|
176
|
-
out.
|
198
|
+
expect(out).to eq("1.0")
|
177
199
|
end
|
178
200
|
end
|
179
201
|
|
@@ -190,14 +212,13 @@ describe "bundle exec" do
|
|
190
212
|
|
191
213
|
it "works when unlocked" do
|
192
214
|
bundle "exec fizz_git"
|
193
|
-
out.
|
215
|
+
expect(out).to eq("1.0")
|
194
216
|
end
|
195
217
|
|
196
218
|
it "works when locked" do
|
197
|
-
bundle "lock"
|
198
219
|
should_be_locked
|
199
220
|
bundle "exec fizz_git"
|
200
|
-
out.
|
221
|
+
expect(out).to eq("1.0")
|
201
222
|
end
|
202
223
|
end
|
203
224
|
|
@@ -214,14 +235,13 @@ describe "bundle exec" do
|
|
214
235
|
|
215
236
|
it "works when unlocked" do
|
216
237
|
bundle "exec fizz_no_gemspec"
|
217
|
-
out.
|
238
|
+
expect(out).to eq("1.0")
|
218
239
|
end
|
219
240
|
|
220
241
|
it "works when locked" do
|
221
|
-
bundle "lock"
|
222
242
|
should_be_locked
|
223
243
|
bundle "exec fizz_no_gemspec"
|
224
|
-
out.
|
244
|
+
expect(out).to eq("1.0")
|
225
245
|
end
|
226
246
|
end
|
227
247
|
|