diff options
| author | Jack Nagel | 2014-07-12 19:56:58 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-12 19:56:58 -0500 |
| commit | 398964e747a5eaa9e9a099d3fc47c3a4e9badba2 (patch) | |
| tree | e680c705962dbbc0ddb63376b1e8d4165720226c /Library/Homebrew/test | |
| parent | d2d257af4a223144f2b9c8310fad82758c211e89 (diff) | |
| download | homebrew-398964e747a5eaa9e9a099d3fc47c3a4e9badba2.tar.bz2 | |
Handle conflicts where links point at symlinks
Fixes #30664.
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_keg.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_keg.rb b/Library/Homebrew/test/test_keg.rb index e415be433..fa7d591dc 100644 --- a/Library/Homebrew/test/test_keg.rb +++ b/Library/Homebrew/test/test_keg.rb @@ -217,4 +217,20 @@ class LinkTests < Homebrew::TestCase assert_predicate link.resolved_path, :symlink? assert_predicate link.lstat, :symlink? end + + def test_links_to_symlinks_are_not_removed + a = HOMEBREW_CELLAR.join("a", "1.0") + b = HOMEBREW_CELLAR.join("b", "1.0") + + a.join("lib", "example").mkpath + a.join("lib", "example2").make_symlink "example" + b.join("lib", "example2").mkpath + + Keg.new(a).link + + lib = HOMEBREW_PREFIX.join("lib") + assert_equal 2, lib.children.length + assert_raises(Keg::ConflictError) { Keg.new(b).link } + assert_equal 2, lib.children.length + end end |
