aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_pathname.rb
diff options
context:
space:
mode:
authorJack Nagel2015-03-26 22:02:15 -0400
committerJack Nagel2015-03-26 22:02:15 -0400
commit522f7ea8c729ef6a5fddc5921ba045713236c28d (patch)
tree23f79171e4413786f4dcd4ed9e35cb190a39c88e /Library/Homebrew/test/test_pathname.rb
parent8a8de3a29678eb64e7686bc5e35701edb84e9946 (diff)
downloadbrew-522f7ea8c729ef6a5fddc5921ba045713236c28d.tar.bz2
Add tests for cp_path_sub
Diffstat (limited to 'Library/Homebrew/test/test_pathname.rb')
-rw-r--r--Library/Homebrew/test/test_pathname.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_pathname.rb b/Library/Homebrew/test/test_pathname.rb
index 73b631abe..3db015967 100644
--- a/Library/Homebrew/test/test_pathname.rb
+++ b/Library/Homebrew/test/test_pathname.rb
@@ -124,6 +124,18 @@ class PathnameTests < Homebrew::TestCase
@dst.install @src
assert_equal "a", File.read(@dst+@src.basename+@file.basename)
end
+
+ def test_cp_path_sub_file
+ @file.write "a"
+ @file.cp_path_sub @src, @dst
+ assert_equal "a", File.read(@dst+"foo")
+ end
+
+ def test_cp_path_sub_directory
+ @dir.mkpath
+ @dir.cp_path_sub @src, @dst
+ assert_predicate @dst+@dir.basename, :directory?
+ end
end
class PathnameInstallTests < Homebrew::TestCase