aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-07-11 18:58:42 -0500
committerJack Nagel2014-07-11 19:01:55 -0500
commit3495aa3f24fe19345b54a22f47257042497bec1a (patch)
tree6493f8943937fcf462fc9b3145764baab5f36676
parentc641a3ca4502935c109aae1c4b95707f3365cdfb (diff)
downloadhomebrew-3495aa3f24fe19345b54a22f47257042497bec1a.tar.bz2
Add test for InstallRenamed module
-rw-r--r--Library/Homebrew/test/test_pathname.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_pathname.rb b/Library/Homebrew/test/test_pathname.rb
index a20f36c75..06e676d76 100644
--- a/Library/Homebrew/test/test_pathname.rb
+++ b/Library/Homebrew/test/test_pathname.rb
@@ -1,6 +1,7 @@
require 'testing_env'
require 'tmpdir'
require 'extend/pathname'
+require 'install_renamed'
class PathnameExtensionTests < Homebrew::TestCase
include FileUtils
@@ -197,4 +198,16 @@ class PathnameExtensionTests < Homebrew::TestCase
@dir.install(@file)
assert_predicate @dir, :directory?
end
+
+ def test_install_renamed
+ @dir.extend(InstallRenamed)
+
+ @file.write "a"
+ @dir.install @file
+ @file.write "b"
+ @dir.install @file
+
+ assert_equal "a", File.read(@dir+@file.basename)
+ assert_equal "b", File.read(@dir+"#{@file.basename}.default")
+ end
end