aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-04-18 23:51:32 +0800
committerXu Cheng2015-04-18 23:51:32 +0800
commit681c6f37cfbf6b51965a9aeab5b137e1a3166a8f (patch)
tree46273f03a487083f06f16f5449fea1fa09f128ee /Library
parent5818f2ed892b54382d14549679d52ffa66173a8a (diff)
downloadhomebrew-681c6f37cfbf6b51965a9aeab5b137e1a3166a8f.tar.bz2
txt2tags: modernize and add test
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/txt2tags.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/Library/Formula/txt2tags.rb b/Library/Formula/txt2tags.rb
index c5d537e29..29e3c3e0a 100644
--- a/Library/Formula/txt2tags.rb
+++ b/Library/Formula/txt2tags.rb
@@ -1,12 +1,16 @@
-require 'formula'
-
class Txt2tags < Formula
- homepage 'http://txt2tags.org'
- url 'https://txt2tags.googlecode.com/files/txt2tags-2.6.tgz'
- sha1 '91bc47e02b9ec7f2fa39c8f7ff5c260164a74718'
+ homepage "http://txt2tags.org"
+ url "https://txt2tags.googlecode.com/files/txt2tags-2.6.tgz"
+ sha256 "601467d7860f3cfb3d48050707c6277ff3ceb22fa7be4f5bd968de540ac5b05c"
def install
- bin.install 'txt2tags'
+ bin.install "txt2tags"
man1.install "doc/manpage.man" => "txt2tags.1"
end
+
+ test do
+ (testpath/"test.txt").write ("\n= Title =")
+ system bin/"txt2tags", "-t", "html", "--no-headers", "test.txt"
+ assert_match %r{<H1>Title</H1>}, File.read("test.html")
+ end
end