lib/pork.rb in pork-1.1.2 vs lib/pork.rb in pork-1.1.3

- old
+ new

@@ -15,10 +15,15 @@ # default to :execute while eliminating warnings for uninitialized ivar def self.execute_mode execute=nil @execute = execute || @execute ||= :execute end + def self.Rainbows! + require 'pork/extra/rainbows' + Pork::Stat.__send__(:include, Pork::Rainbows) + end + def self.stat @stat ||= Pork::Stat.new end def self.seed @@ -30,12 +35,12 @@ end def self.trap sig='SIGINT' Signal.trap(sig) do stat.report - puts "\nterminated by signal SIGINT" - exit! 255 + puts "\nterminated by signal #{sig}" + exit 255 end end def self.run if ENV['PORK_TEST'] @@ -47,11 +52,11 @@ else @stat = Executor.public_send(execute_mode, stat, paths) end else puts "Cannot find test: #{ENV['PORK_TEST']}" - exit! 254 + exit 254 end else @stat = Executor.public_send(execute_mode, stat) end end @@ -65,9 +70,9 @@ require "pork/mode/#{execute_mode}" if execute_mode != :execute seed trap run stat.report - exit! stat.failures.size + stat.errors.size + ($! && 1).to_i + exit stat.failures + stat.errors + ($! && 1).to_i end end end