From bb5e514321732ee6fac150cdbfb587cca5c20433 Mon Sep 17 00:00:00 2001 From: Samantha McVey Date: Wed, 9 Nov 2016 22:15:03 -0800 Subject: Update rakefile so that it will return an exit code of 1 if there is a failure (Travis CI needs this). Make ISO-8859* encoding detections notices not failures --- Rakefile | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index b87f1aef..6a31bd72 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,23 @@ -task default: %w[test] - -task :test do - failed = false - Dir["./tests/*.rb"].each do |test_file| - begin - ruby test_file - puts "" - rescue - puts "FAILED #{test_file}!" - puts "" - failed = true - end +task default: %w[encoding yaml return_code] +$failure = 0 +task :encoding do + begin + ruby 'tests/encoding.rb' + rescue Exception => msg + puts msg + $failure += 1 end - - if failed - exit 0 +end +task :yaml do + begin + ruby 'tests/yaml.rb' + rescue Exception => msg + puts msg + $failure += 1 + end +end +task :return_code do + if $failure != 0 + raise "Failed #{$failure} tests!!" end end -- cgit v1.2.3