diff --git a/Formula/bats-core.rb b/Formula/bats-core.rb new file mode 100644 index 0000000000000..bc1a64e04dee4 --- /dev/null +++ b/Formula/bats-core.rb @@ -0,0 +1,24 @@ +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.0.1.tar.gz" + sha256 "821626f1e5058a4f25a95722399b460942f27535186a815a279e518b503f8de7" + + 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