aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2014-12-28 22:06:35 +0800
committerMike McQuaid2014-12-28 14:37:14 +0000
commita9f4fe57ae08564036ada14446e13371a7fd1065 (patch)
treec3dc97440b2e8541bd1f00cc4c6cf0255ebd78d5
parent44d789e30bb185a889eab3e001a78d1bc53cef73 (diff)
downloadhomebrew-a9f4fe57ae08564036ada14446e13371a7fd1065.tar.bz2
gnu-indent: add test
Closes #35310. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-rw-r--r--Library/Formula/gnu-indent.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/Library/Formula/gnu-indent.rb b/Library/Formula/gnu-indent.rb
index 230b883ca..5d2336f1f 100644
--- a/Library/Formula/gnu-indent.rb
+++ b/Library/Formula/gnu-indent.rb
@@ -1,5 +1,3 @@
-require "formula"
-
class GnuIndent < Formula
homepage "https://www.gnu.org/software/indent/"
url "http://ftpmirror.gnu.org/indent/indent-2.2.10.tar.gz"
@@ -28,6 +26,18 @@ class GnuIndent < Formula
system "./configure", *args
system "make", "install"
end
+
+ test do
+ (testpath/"test.c").write("int main(){ return 0; }")
+ system "#{bin}/gindent", "test.c"
+ assert_equal File.read("test.c"), <<-EOS.undent
+ int
+ main ()
+ {
+ return 0;
+ }
+ EOS
+ end
end
__END__