Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setup/teardown bug. Add support for runner addons
- Loading branch information
Josep M. Bach
committed
Aug 2, 2011
1 parent
f09466b
commit ab25805
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
at_exit{$c.map{|t|i=t.new;i.setup rescue 0;$t=t.instance_methods(!0).map{|m|m\ | ||
=~/^test_/?(i.send m;1):!0}.compact;i.teardown rescue 0};printf"\e[0m\n%fs\n%d\ | ||
tests, %d assertions, %d failures\n\n%s",Time.now-$n,$t.size,$a,$f.size,$f.\ | ||
at_exit{$c.map{|t|i=t.new;$t=t.instance_methods(!0).send($r){|m|m=~/^test_/?(i\ | ||
.setup rescue 0;i.send m;i.teardown rescue 0;1):nil}.compact};printf"\e[0m\n%fs | ||
%d tests, %d assertions, %d failures\n\n%s",Time.now-$n,$t.size,$a,$f.size,$f.\ | ||
map{|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=Time.now;$f=[];$c=[];$a=0;$t=[] | ||
A.inherited(b);$c<<b;end;end;$n=Time.now;$f=[];$c=[];$a=0;$t=[];$r='map' |