提交 d4e484b2 编写于 作者: M Mislav Marohnić

Skip fish completion tests if fish is not installed

Fixes #1654
上级 b35f401a
...@@ -107,6 +107,10 @@ setup_tmp_home = lambda { |shell| ...@@ -107,6 +107,10 @@ setup_tmp_home = lambda { |shell|
} }
$tmux = nil $tmux = nil
$installed_shells = Hash.new { |cache, shell|
`which #{shell} 2>/dev/null`
cache[shell] = $?.success?
}
Before('@completion') do Before('@completion') do
unless $tmux unless $tmux
...@@ -126,7 +130,12 @@ World Module.new { ...@@ -126,7 +130,12 @@ World Module.new {
attr_reader :shell attr_reader :shell
def set_shell(shell) def set_shell(shell)
@shell = shell if $installed_shells[shell]
@shell = shell
true
else
false
end
end end
define_method(:tmux_pane) do define_method(:tmux_pane) do
...@@ -221,7 +230,7 @@ World Module.new { ...@@ -221,7 +230,7 @@ World Module.new {
} }
Given(/^my shell is (\w+)$/) do |shell| Given(/^my shell is (\w+)$/) do |shell|
set_shell(shell) set_shell(shell) || pending
setup_tmp_home.call(shell) setup_tmp_home.call(shell)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册