aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/dos2unix.rb
diff options
context:
space:
mode:
authorMike Naberezny2014-04-08 10:58:44 -0700
committerMike McQuaid2014-04-08 19:15:41 +0100
commit7f7270c683f08789df581f48c793087267397260 (patch)
treecb9a54b350187d21b51beb94dbbb65bdf7566234 /Library/Formula/dos2unix.rb
parent47e364ad197b06192493f3ef1711960b35722a51 (diff)
downloadhomebrew-7f7270c683f08789df581f48c793087267397260.tar.bz2
dos2unix: improve test by reusing pathname and checking all output
Closes #28254. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/dos2unix.rb')
-rw-r--r--Library/Formula/dos2unix.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/Library/Formula/dos2unix.rb b/Library/Formula/dos2unix.rb
index 5ec6a3543..68a8862d8 100644
--- a/Library/Formula/dos2unix.rb
+++ b/Library/Formula/dos2unix.rb
@@ -24,11 +24,10 @@ class Dos2unix < Formula
end
test do
- (testpath/'dosfile.txt').write("File with CRLFs\r\nThey will be converted")
- system "#{bin}/dos2unix", 'dosfile.txt'
- open('dosfile.txt') do |f|
- converted = f.read(64)
- fail if converted.include?("\r")
- end
+ path = testpath/"test.txt"
+ path.write "foo\r\nbar\r\n"
+
+ system "#{bin}/dos2unix", path
+ assert_equal "foo\nbar\n", path.read
end
end