2018-06-14 07:20:04 +00:00
|
|
|
class BatsCore < Formula
|
|
|
|
desc "Bash Automated Testing System"
|
|
|
|
homepage "https://github.com/bats-core/bats-core"
|
2018-06-19 01:35:50 +00:00
|
|
|
url "https://github.com/bats-core/bats-core/archive/v1.0.2.tar.gz"
|
|
|
|
sha256 "4ad77fbf3c0be1f1221477a3df7af13884f33f56d9596ad7c6e37e2d9ae45ff0"
|
2018-06-14 07:20:04 +00:00
|
|
|
|
|
|
|
bottle :unneeded
|
|
|
|
|
|
|
|
conflicts_with "bats", :because => "both install `bats` executables"
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "./install.sh", prefix
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.sh").write <<~EOS
|
|
|
|
@test "addition using bc" {
|
|
|
|
result="$(echo 2+2 | bc)"
|
|
|
|
[ "$result" -eq 4 ]
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
assert_match "addition", shell_output("#{bin}/bats test.sh")
|
|
|
|
end
|
|
|
|
end
|