From 7ede3d80ffeb1a919d583f8a36db66e89b414ae3 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Thu, 14 Feb 2013 23:51:45 -0800 Subject: Merge pull request #1983 from takkanm/add-grep-option Add: grep option for bundle open Conflicts: lib/bundler/cli.rb lib/bundler/ui.rb --- spec/other/open_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spec/other') 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 -- cgit v1.2.1