summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/bundler/install/gems/standalone_spec.rb35
1 files changed, 27 insertions, 8 deletions
diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb
index e0f87572da..8073559479 100644
--- a/spec/bundler/install/gems/standalone_spec.rb
+++ b/spec/bundler/install/gems/standalone_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.shared_examples "bundle install --standalone" do
+RSpec.describe "bundle install --standalone" do
shared_examples "common functionality" do
it "still makes the gems available to normal bundler" do
args = expected_gems.map {|k, v| "#{k} #{v}" }
@@ -237,6 +237,8 @@ RSpec.shared_examples "bundle install --standalone" do
end
end
+ let(:cwd) { bundled_app }
+
describe "with Gemfiles using relative path sources and app moved to a different root" do
before do
FileUtils.mkdir_p bundled_app("app/vendor")
@@ -511,16 +513,33 @@ RSpec.shared_examples "bundle install --standalone" do
end
end
-RSpec.describe "bundle install --standalone" do
- let(:cwd) { bundled_app }
-
- include_examples("bundle install --standalone")
-end
-
RSpec.describe "bundle install --standalone run in a subdirectory" do
let(:cwd) { bundled_app("bob").tap(&:mkpath) }
- include_examples("bundle install --standalone")
+ before do
+ gemfile <<-G
+ source "https://gem.repo1"
+ gem "rails"
+ G
+ end
+
+ it "generates the script in the proper place" do
+ bundle :install, standalone: true, dir: cwd
+
+ expect(bundled_app("bundle/bundler/setup.rb")).to exist
+ end
+
+ context "when path set to a relative path" do
+ before do
+ bundle "config set --local path bundle"
+ end
+
+ it "generates the script in the proper place" do
+ bundle :install, standalone: true, dir: cwd
+
+ expect(bundled_app("bundle/bundler/setup.rb")).to exist
+ end
+ end
end
RSpec.describe "bundle install --standalone --local" do