summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-03-28 20:37:19 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-04-04 19:21:21 -0500
commit73face93768728a91e8272db676cf3232dd4abb5 (patch)
treea43460ba01a5cadd456c93693b633b932bf8aaad
parent09fb78c5c8cabf9b22800c8455e4d2ddfee5403a (diff)
downloadbundler-seg-exec-outside-bundle.tar.gz
Update exec spec to have a different expectation for RG < 2.6.2seg-exec-outside-bundle
-rw-r--r--spec/commands/exec_spec.rb23
-rw-r--r--spec/runtime/setup_spec.rb2
2 files changed, 20 insertions, 5 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index d04d1c99b1..18f17b0fc8 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -218,14 +218,29 @@ RSpec.describe "bundle exec" do
expect(out).to include("bundler: exec needs a command to run")
end
- it "raises a helpful error when exec'ing to something outside of the bundle" do
+ it "raises a helpful error when exec'ing to something outside of the bundle", :rubygems => ">= 2.5.2" do
install_gemfile! <<-G
- gem "rack"
+ source "file://#{gem_repo1}"
+ gem "with_license"
+ G
+ [true, false].each do |l|
+ bundle! "config disable_exec_load #{l}"
+ bundle "exec rackup"
+ expect(err).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
+ end
+ end
+
+ # Different error message on old RG versions (before activate_bin_path) because they
+ # called `Kernel#gem` directly
+ it "raises a helpful error when exec'ing to something outside of the bundle", :rubygems => "< 2.5.2" do
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "with_license"
G
[true, false].each do |l|
bundle! "config disable_exec_load #{l}"
- bundle "exec rake"
- expect(err).to include "can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
+ bundle "exec rackup"
+ expect(err).to include "rack is not part of the bundle. Add it to your Gemfile."
end
end
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index be0c7a1593..809b0a15fd 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -891,7 +891,7 @@ end
end
R
- expect(out).to eq("rack is not part of the bundle. Add it to Gemfile.")
+ expect(out).to eq("rack is not part of the bundle. Add it to your Gemfile.")
end
it "sets GEM_HOME appropriately" do