aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_formula_test.rb
blob: 5ad2db9e985e36ebf43e15f40014e27a6a8a12c8 (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
25
26
27
28
29
30
require "testing_env"

class IntegrationCommandTestTestFormula < IntegrationCommandTestCase
  def test_test_formula
    assert_match "This command requires a formula argument", cmd_fail("test")
    assert_match "Testing requires the latest version of testball",
      cmd_fail("test", testball)

    cmd("install", testball)
    assert_match "testball defines no test", cmd_fail("test", testball)

    setup_test_formula "testball_copy", <<-EOS.undent
      head "https://github.com/example/testball2.git"

      devel do
        url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
        sha256 "#{TESTBALL_SHA256}"
      end

      keg_only "just because"

      test do
      end
    EOS

    cmd("install", "testball_copy")
    assert_match "Testing testball_copy", cmd("test", "--HEAD", "testball_copy")
    assert_match "Testing testball_copy", cmd("test", "--devel", "testball_copy")
  end
end