|
59 | 59 | expect(the_bundle).to include_gems "myrack 1.0.0" |
60 | 60 | end |
61 | 61 |
|
62 | | - context "with path_relative_to_cwd set to true" do |
63 | | - before { bundle "config set path_relative_to_cwd true" } |
64 | | - |
65 | | - it "installs the bundle relatively to current working directory" do |
66 | | - bundle "install --gemfile='#{bundled_app}/Gemfile' --path vendor/bundle", dir: bundled_app.parent |
67 | | - expect(out).to include("installed into `./vendor/bundle`") |
68 | | - expect(bundled_app("../vendor/bundle")).to be_directory |
69 | | - expect(the_bundle).to include_gems "myrack 1.0.0" |
70 | | - end |
| 62 | + it "installs the bundle relatively to repository root, when Bundler run from the same directory" do |
| 63 | + bundle "config path vendor/bundle", dir: bundled_app.parent |
| 64 | + bundle "install --gemfile='#{bundled_app}/Gemfile'", dir: bundled_app.parent |
| 65 | + expect(out).to include("installed into `./bundled_app/vendor/bundle`") |
| 66 | + expect(bundled_app("vendor/bundle")).to be_directory |
| 67 | + expect(the_bundle).to include_gems "myrack 1.0.0" |
| 68 | + end |
| 69 | + |
| 70 | + it "installs the bundle relatively to repository root, when Bundler run from a different directory" do |
| 71 | + bundle "config path vendor/bundle", dir: bundled_app |
| 72 | + bundle "install --gemfile='#{bundled_app}/Gemfile'", dir: bundled_app.parent |
| 73 | + expect(out).to include("installed into `./bundled_app/vendor/bundle`") |
| 74 | + expect(bundled_app("vendor/bundle")).to be_directory |
| 75 | + expect(the_bundle).to include_gems "myrack 1.0.0" |
| 76 | + end |
71 | 77 |
|
72 | | - it "installs the standalone bundle relative to the cwd" do |
73 | | - bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app.parent |
74 | | - expect(out).to include("installed into `./bundled_app/bundle`") |
75 | | - expect(bundled_app("bundle")).to be_directory |
76 | | - expect(bundled_app("bundle/ruby")).to be_directory |
| 78 | + it "installs the bundle relatively to Gemfile folder, when repository root can't be inferred from settings" do |
| 79 | + bundle "install --gemfile='#{bundled_app}/Gemfile' --path vendor/bundle", dir: bundled_app.parent |
| 80 | + expect(out).to include("installed into `./bundled_app/vendor/bundle`") |
| 81 | + expect(bundled_app("vendor/bundle")).to be_directory |
| 82 | + expect(the_bundle).to include_gems "myrack 1.0.0" |
| 83 | + end |
77 | 84 |
|
78 | | - bundle "config unset path" |
| 85 | + it "installs the standalone bundle relative to the cwd" do |
| 86 | + bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app.parent |
| 87 | + expect(out).to include("installed into `./bundled_app/bundle`") |
| 88 | + expect(bundled_app("bundle")).to be_directory |
| 89 | + expect(bundled_app("bundle/ruby")).to be_directory |
79 | 90 |
|
80 | | - bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app("subdir").tap(&:mkpath) |
81 | | - expect(out).to include("installed into `../bundle`") |
82 | | - expect(bundled_app("bundle")).to be_directory |
83 | | - expect(bundled_app("bundle/ruby")).to be_directory |
84 | | - end |
| 91 | + bundle "config unset path" |
| 92 | + |
| 93 | + bundle :install, gemfile: bundled_app_gemfile, standalone: true, dir: bundled_app("subdir").tap(&:mkpath) |
| 94 | + expect(out).to include("installed into `../bundle`") |
| 95 | + expect(bundled_app("bundle")).to be_directory |
| 96 | + expect(bundled_app("bundle/ruby")).to be_directory |
85 | 97 | end |
86 | 98 | end |
87 | 99 |
|
|
0 commit comments