summaryrefslogtreecommitdiff
path: root/spec/other
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2013-02-14 23:51:45 -0800
committerAndre Arko <andre@arko.net>2013-02-17 00:24:14 -0800
commit7ede3d80ffeb1a919d583f8a36db66e89b414ae3 (patch)
treebe9e8924686eb6114f21ace45e1d3e1ca319a015 /spec/other
parentc0620ef0d05f6f6bfe9208ccaccac92f2558cee9 (diff)
downloadbundler-7ede3d80ffeb1a919d583f8a36db66e89b414ae3.tar.gz
Merge pull request #1983 from takkanm/add-grep-option
Add: grep option for bundle open Conflicts: lib/bundler/cli.rb lib/bundler/ui.rb
Diffstat (limited to 'spec/other')
-rw-r--r--spec/other/open_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/other/open_spec.rb b/spec/other/open_spec.rb
index 6a601943ed..b586376254 100644
--- a/spec/other/open_spec.rb
+++ b/spec/other/open_spec.rb
@@ -37,4 +37,19 @@ describe "bundle open" do
bundle "open Rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""}
expect(out).to match(/did you mean rails\?/i)
end
+
+ it "opens the gem with short words" do
+ bundle "open rec" , :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
+
+ expect(out).to eq("bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}")
+ end
+
+ it "select the gem from many match gems" do
+ env = {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"}
+ bundle "open active" , :env => env do |input|
+ input.puts '2'
+ end
+
+ expect(out).to match(/bundler_editor #{default_bundle_path('gems', 'activerecord-2.3.2')}\z/)
+ end
end