2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-03-31 19:45:55 -07:00
|
|
|
require "cmd/log"
|
2019-03-28 08:35:36 +00:00
|
|
|
require "cmd/shared_examples/args_parse"
|
2017-02-23 06:06:55 +01:00
|
|
|
|
2024-03-31 19:45:55 -07:00
|
|
|
RSpec.describe Homebrew::Cmd::Log do
|
2019-03-28 08:35:36 +00:00
|
|
|
it_behaves_like "parseable arguments"
|
2017-02-23 06:06:55 +01:00
|
|
|
|
2021-02-01 16:14:25 -05:00
|
|
|
it "shows the Git log for a given Formula", :integration_test do
|
2017-02-23 06:06:55 +01:00
|
|
|
setup_test_formula "testball"
|
|
|
|
|
2024-03-06 15:10:14 +01:00
|
|
|
core_tap = CoreTap.instance
|
2017-02-23 06:06:55 +01:00
|
|
|
core_tap.path.cd do
|
2017-07-29 19:55:05 +02:00
|
|
|
system "git", "init"
|
|
|
|
system "git", "add", "--all"
|
|
|
|
system "git", "commit", "-m", "This is a test commit for Testball"
|
2017-02-23 06:06:55 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
core_tap_url = "file://#{core_tap.path}"
|
|
|
|
shallow_tap = Tap.fetch("homebrew", "shallow")
|
2017-07-29 19:55:05 +02:00
|
|
|
|
|
|
|
system "git", "clone", "--depth=1", core_tap_url, shallow_tap.path
|
2017-02-23 06:06:55 +01:00
|
|
|
|
|
|
|
expect { brew "log", "#{shallow_tap}/testball" }
|
|
|
|
.to output(/This is a test commit for Testball/).to_stdout
|
2017-03-18 16:57:40 +02:00
|
|
|
.and output(%r{Warning: homebrew/shallow is a shallow clone}).to_stderr
|
2017-02-23 06:06:55 +01:00
|
|
|
.and be_a_success
|
|
|
|
|
|
|
|
expect(shallow_tap.path/".git/shallow").to exist, "A shallow clone should have been created."
|
|
|
|
end
|
|
|
|
end
|