diff options
| author | ilovezfs | 2016-04-04 03:18:55 -0700 |
|---|---|---|
| committer | ilovezfs | 2016-04-05 07:25:27 -0700 |
| commit | fad235d8e82ae57b2004429a0297f313aafa3186 (patch) | |
| tree | 02b3a8bfbfa5c0ae7deafc0b70fdb52c6bff0b6e /Library/Homebrew/test | |
| parent | 1b7e13df4f936dd318a23698b7b69bd2ca0e2487 (diff) | |
| download | brew-fad235d8e82ae57b2004429a0297f313aafa3186.tar.bz2 | |
tap: support --full even if installed
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.
The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.
Closes #17.
Signed-off-by: ilovezfs <ilovezfs@icloud.com>
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_tap.rb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/Library/Homebrew/test/test_tap.rb b/Library/Homebrew/test/test_tap.rb index fa0602e94..0b2671698 100644 --- a/Library/Homebrew/test/test_tap.rb +++ b/Library/Homebrew/test/test_tap.rb @@ -164,7 +164,32 @@ class TapTest < Homebrew::TestCase end def test_install_tap_already_tapped_error - assert_raises(TapAlreadyTappedError) { @tap.install } + setup_git_repo + already_tapped_tap = Tap.new("Homebrew", "foo") + assert_equal true, already_tapped_tap.installed? + assert_raises(TapAlreadyTappedError) { already_tapped_tap.install } + end + + def test_install_tap_remote_match_already_tapped_error + setup_git_repo + already_tapped_tap = Tap.new("Homebrew", "foo") + assert_equal true, already_tapped_tap.installed? + right_remote = "#{@tap.remote}" + assert_raises(TapAlreadyTappedError) { already_tapped_tap.install :clone_target => right_remote } + end + + def test_install_tap_remote_mismatch_error + setup_git_repo + already_tapped_tap = Tap.new("Homebrew", "foo") + assert_equal true, already_tapped_tap.installed? + wrong_remote = "#{@tap.remote}-oops" + assert_raises(TapRemoteMismatchError) { already_tapped_tap.install :clone_target => wrong_remote } + end + + def test_install_tap_already_unshallow_error + setup_git_repo + already_tapped_tap = Tap.new("Homebrew", "foo") + assert_raises(TapAlreadyUnshallowError) { already_tapped_tap.install :full_clone => true } end def test_uninstall_tap_unavailable_error |
