aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorDominyk Tiller2015-01-14 01:07:45 +0000
committerMike McQuaid2015-01-14 12:31:17 +0000
commit72e77bcc9e68f5a956af6a411d3658c6a189a8e1 (patch)
tree292dc9ff2327e14caa8c9f49b866044178ddede8 /Library/Formula
parent7cd6186bccb09b4dff3ad6d9d3f8e0f03e0246c7 (diff)
downloadhomebrew-72e77bcc9e68f5a956af6a411d3658c6a189a8e1.tar.bz2
bats: modernise and added test
^ Closes #35845. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/bats.rb26
1 files changed, 19 insertions, 7 deletions
diff --git a/Library/Formula/bats.rb b/Library/Formula/bats.rb
index dc1c3a39b..84df88f3a 100644
--- a/Library/Formula/bats.rb
+++ b/Library/Formula/bats.rb
@@ -1,12 +1,24 @@
-require 'formula'
-
class Bats < Formula
- homepage 'https://github.com/sstephenson/bats'
- url 'https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz'
- sha1 'cb8a5f4c844a5f052f915036130def31140fce94'
- head 'https://github.com/sstephenson/bats.git'
+ homepage "https://github.com/sstephenson/bats"
+ url "https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz"
+ sha1 "cb8a5f4c844a5f052f915036130def31140fce94"
+ head "https://github.com/sstephenson/bats.git"
def install
- system './install.sh', prefix
+ system "./install.sh", prefix
+ end
+
+ test do
+ (testpath/"testing.sh").write <<-EOS.undent
+ #!/usr/bin/env bats
+ @test "addition using bc" {
+ result="$(echo 2+2 | bc)"
+ [ "$result" -eq 4 ]
+ }
+ EOS
+
+ chmod 0755, testpath/"testing.sh"
+ output = shell_output("./testing.sh")
+ assert output.include?("addition")
end
end