aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorXu Cheng2015-12-19 21:54:42 +0800
committerXu Cheng2015-12-19 22:05:31 +0800
commitf25894981663ba20596483d8391be232226a4954 (patch)
tree159a12929f32e860ab0ee9d149897cfcb89976a4 /Library/Homebrew/test
parentfe2bec5e8b99d77c8b1af5bcaae9f368d3eabced (diff)
downloadbrew-f25894981663ba20596483d8391be232226a4954.tar.bz2
add IntergrationCommandTests#test_tap
Closes Homebrew/homebrew#47177. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index 859de9f6e..bc60ee0bb 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -127,4 +127,30 @@ class IntegrationCommandTests < Homebrew::TestCase
formula_file.unlink
repo.alias_dir.rmtree
end
+
+ def test_tap
+ path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
+ path.mkpath
+ path.cd do
+ shutup do
+ system "git", "init"
+ system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo"
+ system "git", "add", "--all"
+ system "git", "commit", "-m", "init"
+ end
+ end
+
+ assert_match "homebrew/foo", cmd("tap")
+ assert_match "homebrew/versions", cmd("tap", "--list-official")
+ assert_match "1 tap", cmd("tap-info")
+ assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "homebrew/foo")
+ assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "--json=v1", "--installed")
+ assert_match "Pinned homebrew/foo", cmd("tap-pin", "homebrew/foo")
+ assert_match "homebrew/foo", cmd("tap", "--list-pinned")
+ assert_match "Unpinned homebrew/foo", cmd("tap-unpin", "homebrew/foo")
+ assert_match "Tapped", cmd("tap", "homebrew/bar", path/".git")
+ assert_match "Untapped", cmd("untap", "homebrew/bar")
+ ensure
+ Tap::TAP_DIRECTORY.rmtree
+ end
end