Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add reset in the end to cancel colours

  • Loading branch information...
commit e118e5a81977de9e447f6c5e483c48a2beb4af27 1 parent 745e356
@pitr pitr authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/a.rb
12 lib/a.rb
@@ -1,6 +1,6 @@
-$;$f=[];$c=[];$a=0;class A;def a c;$a+=1;print c ?"\e[32m.\e[0m":($f\
-<<caller[0];"\e[31mF\e[0m");end;def self.inherited(b);$c<<b;end;end;at_exit{$c\{|t|;i.setup rescue nil;$t=t.instance_methods(false).map{|m|i.send\
-m if !%w(setup teardown).include? m}.compact;i.teardown rescue nil};print "\n#{$n} s.\n#{$t.size} tests, #{$a} assertions, #{$f.size} failures\n\n"+
-${|f|"\e[31mFailure\e[0m \e[97m@\e[33m #{f}"}.join("\n");exit -1 if $f[0]}
+at_exit{${|t|;i.setup rescue 0;$t=t.instance_methods(!0).map{|m|i.\
+send m if !(%w(setup teardown)&[m])[0]}.compact;i.teardown rescue 0};printf"\e\
+[0m\n%fs\n%d tests, %d assertions, %d failures\n\n%s",$n,$t.size,$a,$f
+.size,${|f|"\e[1;31mFailure\e[0m \e[97m@\e[33m #{f}\e[0m"}.join(?\n);exit\
+1 if$f[0]};class A;def a c;$a+=1;print"\e[3"+(c ?"2m.":"1mF");$f<<caller[0]if !
+c;end;def A.inherited(b);$c<<b;end;end; $n =; $f = []; $c = []; $a = 0
Please sign in to comment.
Something went wrong with that request. Please try again.