require "integration_cmds_tests" class IntegrationCommandTestTap < IntegrationCommandTests 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" FileUtils.touch "readme" 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 "2 taps", 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") assert_equal "", cmd("tap", "homebrew/bar", path/".git", "-q", "--full") assert_match "Untapped", cmd("untap", "homebrew/bar") end end