blob: 84df88f3a277fdf3f4851dc24fee4d35f7e98d59 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 | class Bats < Formula
  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"
  def install
    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")
  end
end
 |