aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-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")