diff options
Diffstat (limited to 'spec/bundler/commands/binstubs_spec.rb')
-rw-r--r-- | spec/bundler/commands/binstubs_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 0313f48b60..ec402c327c 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/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 |