add IntergrationCommandTests#test_tap
Closes Homebrew/homebrew#47177. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
fe2bec5e8b
commit
f258949816
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user