2013-02-24 19:14:53 +00:00
|
|
|
class Bats < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "A TAP-compliant test framework for Bash scripts"
|
2015-01-14 01:07:45 +00:00
|
|
|
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"
|
2013-02-24 19:14:53 +00:00
|
|
|
|
|
|
|
def install
|
2015-01-14 01:07:45 +00:00
|
|
|
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")
|
2013-02-24 19:14:53 +00:00
|
|
|
end
|
|
|
|
end
|