From 522f7ea8c729ef6a5fddc5921ba045713236c28d Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 26 Mar 2015 22:02:15 -0400 Subject: Add tests for cp_path_sub --- Library/Homebrew/test/test_pathname.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Library') 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 -- cgit v1.2.3