homebrew-core/Formula/zsh-completions.rb
Xu Cheng 5f9cb2fc12 zsh-completion: add test
Closes Homebrew/homebrew#38055.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-25 22:13:33 +08:00

37 lines
1 KiB
Ruby

class ZshCompletions < Formula
homepage "https://github.com/zsh-users/zsh-completions"
url "https://github.com/zsh-users/zsh-completions/archive/0.12.0.tar.gz"
sha256 "770d92749b11b22192595b207208508f8bfa319d5d03210a71bc44c8b9cfa0d5"
head "https://github.com/zsh-users/zsh-completions.git"
def install
(share/"zsh-completions").install Dir["src/_*"]
end
def caveats
<<-EOS.undent
To activate these completions, add the following to your .zshrc:
fpath=(#{HOMEBREW_PREFIX}/share/zsh-completions $fpath)
You may also need to force rebuild `zcompdump`:
rm -f ~/.zcompdump; compinit
Additionally, if you receive "zsh compinit: insecure directories" warnings when attempting
to load these completions, you may need to run this:
chmod go-w /usr/local/share
EOS
end
test do
(testpath/".zshrc").write <<-EOS.undent
fpath=(#{HOMEBREW_PREFIX}/share/zsh-completions $fpath)
autoload -U compinit
compinit
EOS
system "/bin/zsh", "--login", "-i", "-c", "which _ack"
end
end