From 51fe40829e823f7fd18f42c865d2b8d20d2789dd Mon Sep 17 00:00:00 2001 From: Ted Pennings Date: Mon, 13 Jan 2014 21:54:53 -0500 Subject: dos2unix: a test Closes #25887. Signed-off-by: Mike McQuaid --- Library/Formula/dos2unix.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Library/Formula/dos2unix.rb') diff --git a/Library/Formula/dos2unix.rb b/Library/Formula/dos2unix.rb index d03a09d12..7bfba04dd 100644 --- a/Library/Formula/dos2unix.rb +++ b/Library/Formula/dos2unix.rb @@ -22,4 +22,13 @@ class Dos2unix < Formula "LDFLAGS_EXTRA=-L#{gettext.lib} -lintl", "install" 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 + end end -- cgit v1.2.3