aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-01-13 10:38:11 +0100
committerMike McQuaid2015-01-13 13:18:33 +0000
commitf831cb43684fb52546ffc764ee1ea9545f4dbbf2 (patch)
tree332cfebaf81f7fa3a0eec99866b4143805794c84
parentcc0b5549dc902aa0cb643e6b38d4a1fbe942bad2 (diff)
downloadhomebrew-f831cb43684fb52546ffc764ee1ea9545f4dbbf2.tar.bz2
bam: test added
Closes #35812. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-rw-r--r--Library/Formula/bam.rb28
1 files changed, 21 insertions, 7 deletions
diff --git a/Library/Formula/bam.rb b/Library/Formula/bam.rb
index c6c05aef3..ce922e236 100644
--- a/Library/Formula/bam.rb
+++ b/Library/Formula/bam.rb
@@ -1,14 +1,28 @@
-require 'formula'
-
class Bam < Formula
- homepage 'http://matricks.github.io/bam/'
- url 'https://github.com/downloads/matricks/bam/bam-0.4.0.tar.gz'
- sha1 'c0f32ff9272d5552e02a9d68fbdd72106437ee69'
+ homepage "http://matricks.github.io/bam/"
+ url "https://github.com/downloads/matricks/bam/bam-0.4.0.tar.gz"
+ sha1 "c0f32ff9272d5552e02a9d68fbdd72106437ee69"
- head 'https://github.com/matricks/bam.git'
+ head "https://github.com/matricks/bam.git"
def install
system "./make_unix.sh"
- bin.install'bam'
+ bin.install "bam"
+ end
+
+ test do
+ (testpath/"hello.c").write <<-EOS.undent
+ #include <stdio.h>
+ int main(void) { printf("hello\\n"); return 0; }
+ EOS
+
+ (testpath/"bam.lua").write <<-EOS.undent
+ settings = NewSettings()
+ objs = Compile(settings, Collect("*.c"))
+ exe = Link(settings, "hello", objs)
+ EOS
+
+ system "bam", "-v"
+ assert_equal "hello\n", shell_output("./hello")
end
end