aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2014-12-29 15:45:57 +0800
committerMike McQuaid2014-12-29 11:36:20 +0000
commit8d6b58a5469cd9eeb540b97109d612d6db24ea57 (patch)
tree86ab9769c79853cd1d0596298b1d110f6c7d6251 /Library/Formula
parent4210589018d0b9e73e813f225e0a48a5a92ff32a (diff)
downloadhomebrew-8d6b58a5469cd9eeb540b97109d612d6db24ea57.tar.bz2
astyle: add test
Closes #35333. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/astyle.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/Library/Formula/astyle.rb b/Library/Formula/astyle.rb
index c0826f121..e7faa0fd5 100644
--- a/Library/Formula/astyle.rb
+++ b/Library/Formula/astyle.rb
@@ -1,5 +1,3 @@
-require "formula"
-
class Astyle < Formula
homepage "http://astyle.sourceforge.net/"
url "https://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05/astyle_2.05_macosx.tar.gz"
@@ -19,4 +17,16 @@ class Astyle < Formula
bin.install "bin/astyle"
end
end
+
+ test do
+ (testpath/"test.c").write("int main(){return 0;}\n")
+ system "#{bin}/astyle", "--style=gnu", "--indent=spaces=4",
+ "--lineend=linux", "#{testpath}/test.c"
+ assert_equal File.read("test.c"), <<-EOS.undent
+ int main()
+ {
+ return 0;
+ }
+ EOS
+ end
end