aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-07-11 18:58:42 -0500
committerJack Nagel2014-07-11 19:01:55 -0500
commit3b7c5af4315acdd8160d2308445a8ef6fe5141e6 (patch)
tree9cb2d9e28d4ae2113da35bad3fcbd63237314f64 /Library
parent58b99f2cee09e057b299ae1f0b9a705b5484d31a (diff)
downloadbrew-3b7c5af4315acdd8160d2308445a8ef6fe5141e6.tar.bz2
Add test for InstallRenamed module
Diffstat (limited to 'Library')
-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