aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorDominyk Tiller2016-02-16 19:08:56 +0000
committerDominyk Tiller2016-02-21 04:22:23 +0000
commite00375e381c7bcd4f0db0d69944dbf831fc62672 (patch)
tree9b878d39596e013d15b6b712c51d8dfe8e3604e3 /Library/Homebrew/test
parentff4d16deebaabc374f4dae2786bd01e2865875a4 (diff)
downloadbrew-e00375e381c7bcd4f0db0d69944dbf831fc62672.tar.bz2
test_pathname: add append_lines tests
Closes Homebrew/homebrew#49233. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Diffstat (limited to 'Library/Homebrew/test')
-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 5456c5bdc..d29a2bc1e 100644
--- a/Library/Homebrew/test/test_pathname.rb
+++ b/Library/Homebrew/test/test_pathname.rb
@@ -51,6 +51,18 @@ class PathnameTests < Homebrew::TestCase
assert_raises(RuntimeError) { @file.write("CONTENT") }
end
+ def test_append_lines
+ touch @file
+ @file.append_lines("CONTENT")
+ assert_equal "CONTENT\n", File.read(@file)
+ @file.append_lines("CONTENTS")
+ assert_equal "CONTENT\nCONTENTS\n", File.read(@file)
+ end
+
+ def test_append_lines_does_not_create
+ assert_raises(RuntimeError) { @file.append_lines("CONTENT") }
+ end
+
def test_atomic_write
touch @file
@file.atomic_write("CONTENT")