aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_log_formula.rb
blob: 34509bf72b8d42068d000a76e25c6108ad7f852e (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
require "helper/integration_command_test_case"

class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
  def test_log_formula
    core_tap = CoreTap.new
    setup_test_formula "testball"

    core_tap.path.cd do
      shutup do
        system "git", "init"
        system "git", "add", "--all"
        system "git", "commit", "-m", "This is a test commit for Testball"
      end
    end

    core_tap_url = "file://#{core_tap.path}"
    shallow_tap = Tap.fetch("homebrew", "shallow")
    shutup do
      system "git", "clone", "--depth=1", core_tap_url, shallow_tap.path
    end

    assert_match "This is a test commit for Testball",
                 cmd("log", "#{shallow_tap}/testball")
    assert_predicate shallow_tap.path/".git/shallow", :exist?,
                     "A shallow clone should have been created."
  end
end