summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-12-05 22:03:44 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-12-05 22:44:33 +0900
commitaf1f903b8fced5ef74828d245fbb5f6466c3d25a (patch)
tree2d509178a28903593c2be6b488f181a9b0bbb5d7 /spec/commands
parente7243396706e9c29de25638351e7d30027313d59 (diff)
downloadbundler-af1f903b8fced5ef74828d245fbb5f6466c3d25a.tar.gz
Added test example for binstub warning
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/binstubs_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index d78ad50b61..24ee03ec3c 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -50,6 +50,25 @@ RSpec.describe "bundle binstubs <gem>" do
expect(out).to include("`bundle binstubs` needs at least one gem to run.")
end
+ context "when generating bundle binstub outside bundler" do
+ it "should abort" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ bundle "binstubs rack"
+
+ File.open("bin/bundle", "wb") do |file|
+ file.print "OMG"
+ end
+
+ sys_exec "bin/rackup"
+
+ expect(last_command.stderr).to include("was not generated by Bundler")
+ end
+ end
+
context "the bundle binstub" do
before do
if system_bundler_version == :bundler