From f25894981663ba20596483d8391be232226a4954 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sat, 19 Dec 2015 21:54:42 +0800 Subject: [PATCH] add IntergrationCommandTests#test_tap Closes Homebrew/homebrew#47177. Signed-off-by: Xu Cheng --- .../Homebrew/test/test_integration_cmds.rb | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb index 859de9f6ef..bc60ee0bb6 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