From b4990b75100c7b30299df316fe05a1fc534db0df Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 22 Jan 2013 10:15:34 -0800 Subject: binstubs for gems with dev deps don't raise fixes #2272 --- lib/bundler/installer.rb | 2 +- spec/other/binstubs_spec.rb | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 42f66078..9719b945 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -129,7 +129,7 @@ module Bundler def generate_bundler_executable_stubs(spec, options = {}) if spec.executables.empty? options = {} - spec.dependencies.each do |dep| + spec.runtime_dependencies.each do |dep| bins = Bundler.definition.specs[dep].first.executables options[dep.name] = bins unless bins.empty? end diff --git a/spec/other/binstubs_spec.rb b/spec/other/binstubs_spec.rb index 843e15c2..f5e1347a 100644 --- a/spec/other/binstubs_spec.rb +++ b/spec/other/binstubs_spec.rb @@ -133,4 +133,37 @@ describe "bundle binstubs " do end end end + + context "when the gem has no bins" do + it "suggests child gems if they have bins" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "rack-obama" + G + + bundle "binstubs rack-obama" + expect(out).to include('rack-obama has no executables') + expect(out).to include('rack has: rackup') + end + + it "works if child gems don't have bins" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "actionpack" + G + + bundle "binstubs actionpack" + expect(out).to include('no executables for the gem actionpack') + end + + it "works if the gem has development dependencies" do + install_gemfile <<-G + source "file://#{gem_repo1}" + gem "with_development_dependency" + G + + bundle "binstubs with_development_dependency" + expect(out).to include('no executables for the gem with_development_dependency') + end + end end -- cgit v1.2.3