summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Taggart <jeff@jetaggart.com>2014-07-12 15:14:09 -0600
committerJeff Taggart <jeff@jetaggart.com>2014-07-12 15:14:09 -0600
commitbbf74cfd9ea5f92365fef93d22f245f2e5c3dfdf (patch)
treebdb717e2cb5cdb94d6866dd6973908906d21c6f7
parentc9b25371fb37154f215c462a25b834a55c07f72d (diff)
downloadbundler-bbf74cfd9ea5f92365fef93d22f245f2e5c3dfdf.tar.gz
Fix unknown constant error
When the binstubs command loads, cli/common is not loaded which causes it to error out when a gem is not present
-rw-r--r--lib/bundler/cli/binstubs.rb2
-rw-r--r--spec/commands/binstubs_spec.rb13
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb
index 05cad4d147..d5ff5b681a 100644
--- a/lib/bundler/cli/binstubs.rb
+++ b/lib/bundler/cli/binstubs.rb
@@ -1,3 +1,5 @@
+require "bundler/cli/common"
+
module Bundler
class CLI::Binstubs
attr_reader :options, :gems
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index 0f04ad4dd9..e307539f76 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -105,6 +105,19 @@ describe "bundle binstubs <gem>" do
end
end
+ context "when the gem doesn't exist" do
+ it "displays an error with correct status" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ G
+
+ bundle "binstubs doesnt_exist", :exitstatus => true
+
+ expect(exitstatus).to eq(7)
+ expect(out).to eq("Could not find gem 'doesnt_exist'.")
+ end
+ end
+
context "--path" do
it "sets the binstubs dir" do
install_gemfile <<-G