summaryrefslogtreecommitdiff
path: root/spec/bundler/commands/open_spec.rb
diff options
context:
space:
mode:
authorZehan Zhao <cnallenzhao@gmail.com>2016-08-15 22:44:19 +0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-18 13:44:26 +0900
commitd80f5399adc3564d05339e6dff92ea1e95fb280a (patch)
treea8e734c158d39cf9481107b2145b55c55724c366 /spec/bundler/commands/open_spec.rb
parent98841b2b19fc2d5c6aacda26019ff07d48d971ec (diff)
[bundler/bundler] Fix open default gem error
https://github.com/bundler/bundler/commit/792d724752
Diffstat (limited to 'spec/bundler/commands/open_spec.rb')
-rw-r--r--spec/bundler/commands/open_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/bundler/commands/open_spec.rb b/spec/bundler/commands/open_spec.rb
index 51af34a875..649ae06fda 100644
--- a/spec/bundler/commands/open_spec.rb
+++ b/spec/bundler/commands/open_spec.rb
@@ -91,4 +91,17 @@ RSpec.describe "bundle open" do
expect(out).not_to include("BUNDLE_GEMFILE=")
end
end
+
+ context "when opening a default gem" do
+ before do
+ install_gemfile <<-G
+ gem "json"
+ G
+ end
+
+ it "throws proper error when trying to open default gem" do
+ bundle "open json", :env => { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" }
+ expect(out).to include("Unable to open json because it's a default gem, so the directory it would normally be installed to does not exist.")
+ end
+ end
end