From 601dcbeca478682d67ebcbc1164cbd1bf25ff616 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Mon, 20 Apr 2015 22:19:51 +0800 Subject: v: add test and modernize --- Library/Formula/v.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'Library/Formula') 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 -- cgit v1.2.3