From 7f7270c683f08789df581f48c793087267397260 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Tue, 8 Apr 2014 10:58:44 -0700 Subject: dos2unix: improve test by reusing pathname and checking all output Closes #28254. Signed-off-by: Mike McQuaid --- Library/Formula/dos2unix.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Library/Formula/dos2unix.rb') 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 -- cgit v1.2.3