homebrew-core/Formula/bats-core.rb
2018-07-09 02:44:27 +01:00

24 lines
644 B
Ruby

class BatsCore < Formula
desc "Bash Automated Testing System"
homepage "https://github.com/bats-core/bats-core"
url "https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz"
sha256 "855d8b8bed466bc505e61123d12885500ef6fcdb317ace1b668087364717ea82"
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