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-07-09 01:44:27 +00:00
|
|
|
url "https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz"
|
|
|
|
sha256 "855d8b8bed466bc505e61123d12885500ef6fcdb317ace1b668087364717ea82"
|
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
|