aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-04-20 22:19:51 +0800
committerXu Cheng2015-04-20 22:19:51 +0800
commit601dcbeca478682d67ebcbc1164cbd1bf25ff616 (patch)
tree303eefebbdf998774a9726a52b13db822c997b7f
parente5a187bc0c66fa241ad393eee894a68eecb697eb (diff)
downloadhomebrew-601dcbeca478682d67ebcbc1164cbd1bf25ff616.tar.bz2
v: add test and modernize
-rw-r--r--Library/Formula/v.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/Library/Formula/v.rb b/Library/Formula/v.rb
index 48d0fe1e6..48e30d0f0 100644
--- a/Library/Formula/v.rb
+++ b/Library/Formula/v.rb
@@ -1,13 +1,17 @@
-require 'formula'
-
class V < Formula
- homepage 'https://github.com/rupa/v'
- head 'https://github.com/rupa/v.git'
- url 'https://github.com/rupa/v/archive/v1.0.tar.gz'
- sha1 '9e8ce44167a97c10ab41b8fc0e5ec1b2d1cbc4f3'
+ homepage "https://github.com/rupa/v"
+ head "https://github.com/rupa/v.git"
+ url "https://github.com/rupa/v/archive/v1.0.tar.gz"
+ sha256 "fc25860c29a2d02908f4c2b6ecf0499e0121393a0ec13ec1c047f7a6ead100f1"
def install
- bin.install 'v'
- man1.install 'v.1'
+ bin.install "v"
+ man1.install "v.1"
+ end
+
+ test do
+ (testpath/".vimrc").write "set viminfo='25,\"50,n#{testpath}/.viminfo"
+ system "/usr/bin/vim", "-u", testpath/".vimrc", "+wq", "test.txt"
+ assert_equal "#{testpath}/test.txt", shell_output("#{bin}/v -a --debug").chomp
end
end