aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2015-03-25 21:37:26 -0400
committerJack Nagel2015-03-25 21:37:26 -0400
commit98fd33462e078b65c8e28d54e7a0f1d902bcfdeb (patch)
tree8d896a7ed053978d9bce9c85630b831eade788cb
parentcd95a13de35f802abf562bc75df482b6c7317a9c (diff)
downloadhomebrew-98fd33462e078b65c8e28d54e7a0f1d902bcfdeb.tar.bz2
Pull install tests into a separate class
-rw-r--r--Library/Homebrew/test/test_pathname.rb40
1 files changed, 21 insertions, 19 deletions
diff --git a/Library/Homebrew/test/test_pathname.rb b/Library/Homebrew/test/test_pathname.rb
index c59571305..23b2108a7 100644
--- a/Library/Homebrew/test/test_pathname.rb
+++ b/Library/Homebrew/test/test_pathname.rb
@@ -95,6 +95,27 @@ class PathnameExtensionTests < Homebrew::TestCase
refute_predicate @file, :exist?
end
+ def test_install_creates_intermediate_directories
+ touch @file
+ refute_predicate @dir, :directory?
+ @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
+
+class PathnameInstallTests < PathnameExtensionTests
def setup_install_test
(@src+'a.txt').write 'This is sample file a.'
(@src+'b.txt').write 'This is sample file b.'
@@ -186,23 +207,4 @@ class PathnameExtensionTests < Homebrew::TestCase
assert_predicate @dst+"bin/b.txt", :exist?
assert_predicate (@dst+"bin").readlink, :relative?
end
-
- def test_install_creates_intermediate_directories
- touch @file
- refute_predicate @dir, :directory?
- @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