diff options
| author | Mike Naberezny | 2014-04-08 10:58:44 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2014-04-08 19:15:41 +0100 |
| commit | 7f7270c683f08789df581f48c793087267397260 (patch) | |
| tree | cb9a54b350187d21b51beb94dbbb65bdf7566234 | |
| parent | 47e364ad197b06192493f3ef1711960b35722a51 (diff) | |
| download | homebrew-7f7270c683f08789df581f48c793087267397260.tar.bz2 | |
dos2unix: improve test by reusing pathname and checking all output
Closes #28254.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rw-r--r-- | Library/Formula/dos2unix.rb | 11 |
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 |
