diff options
| author | Ted Pennings | 2014-01-13 21:54:53 -0500 |
|---|---|---|
| committer | Mike McQuaid | 2014-01-15 09:08:57 +0000 |
| commit | 51fe40829e823f7fd18f42c865d2b8d20d2789dd (patch) | |
| tree | 6ed9d9c8a2c4f4beb26e3297c408c6237d28927f /Library/Formula/dos2unix.rb | |
| parent | ea123e767df67cb80b6b54ddad210ddc02ab37f6 (diff) | |
| download | homebrew-51fe40829e823f7fd18f42c865d2b8d20d2789dd.tar.bz2 | |
dos2unix: a test
Closes #25887.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/dos2unix.rb')
| -rw-r--r-- | Library/Formula/dos2unix.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 |
