aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorAndrea Kao2016-06-12 05:50:35 -0700
committerMike McQuaid2016-06-12 13:50:34 +0100
commit3f7fffe17d04de0aefc9c3a405cea54687834dda (patch)
tree93802378b12694e0247d70f28159bf88f2f302d2 /Library/Homebrew
parente9cc2a5d88da6d1719763a26c1fc455c51e2c3db (diff)
downloadbrew-3f7fffe17d04de0aefc9c3a405cea54687834dda.tar.bz2
tests: extend cmd/log integration test (#333)
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index a16658125..2640e2df6 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -700,6 +700,38 @@ class IntegrationCommandTests < Homebrew::TestCase
(HOMEBREW_REPOSITORY/".git").rmtree
end
+ def test_log_formula
+ core_tap = CoreTap.new
+ formula_file = core_tap.formula_dir/"testball.rb"
+ formula_file.write <<-EOS.undent
+ class Testball < Formula
+ url "https://example.com/testball-0.1.tar.gz"
+ end
+ EOS
+
+ 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
+
+ homebrew_core_clone = Pathname.new core_tap.path.dirname/"homebrew-core-clone"
+ shallow = Pathname.new homebrew_core_clone/".git/shallow"
+
+ (core_tap.path.dirname).cd do
+ system "git", "clone", "--depth=1", "file://#{core_tap.path}", "homebrew-core-clone"
+
+ assert_match "This is a test commit for Testball", cmd("log", "testball")
+ assert_predicate shallow, :exist?, "A shallow clone should have been created."
+ end
+ ensure
+ formula_file.unlink
+ (core_tap.path/".git").rmtree
+ (core_tap.path.dirname/"homebrew-core-clone").rmtree
+ end
+
def test_leaves
formula_dir = CoreTap.new.formula_dir
formula_file1 = formula_dir/"testball1.rb"