Skip to content
Snippets Groups Projects
Commit bab96dd3 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #2118 from reitermarkus/spec-log

Convert `brew log` test to spec.
parents 0f45e60b d9b2fdbe
No related branches found
No related tags found
No related merge requests found
require "testing_env"
describe "brew log", :integration_test do
it "shows the Git log for the Homebrew repository when no argument is given" do
HOMEBREW_REPOSITORY.cd do
shutup do
system "git", "init"
system "git", "commit", "--allow-empty", "-m", "This is a test commit"
end
end
class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
def test_log_formula
core_tap = CoreTap.new
expect { brew "log" }
.to output(/This is a test commit/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
it "shows the Git log for a given Formula" do
setup_test_formula "testball"
core_tap = CoreTap.new
core_tap.path.cd do
shutup do
system "git", "init"
......@@ -19,9 +31,11 @@ class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
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."
expect { brew "log", "#{shallow_tap}/testball" }
.to output(/This is a test commit for Testball/).to_stdout
.and output(/Warning: The git repository is a shallow clone/).to_stderr
.and be_a_success
expect(shallow_tap.path/".git/shallow").to exist, "A shallow clone should have been created."
end
end
require "testing_env"
class IntegrationCommandTestLog < IntegrationCommandTestCase
def test_log
FileUtils.cd HOMEBREW_REPOSITORY do
shutup do
system "git", "init"
system "git", "commit", "--allow-empty", "-m", "This is a test commit"
end
end
assert_match "This is a test commit", cmd("log")
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment