Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
codebrawl entry - ruby testing libraries
$n=Time.now;$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\
.map{|t|i=t.new;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#{
Time.now-$n} s.\n#{$t.size} tests, #{$a} assertions, #{$f.size} failures\n\n"+
$f.map{|f|"\e[31mFailure\e[0m \e[97m@\e[33m #{f}"}.join("\n");exit -1 if $f[0]}
@masylum

This comment has been minimized.

Show comment
Hide comment
@masylum

masylum Jul 6, 2011

That's a win!

masylum commented Jul 6, 2011

That's a win!

@jamesu

This comment has been minimized.

Show comment
Hide comment
@jamesu

jamesu Jul 15, 2011

Looks great! :)

jamesu commented Jul 15, 2011

Looks great! :)

@bltavares

This comment has been minimized.

Show comment
Hide comment
@bltavares

bltavares Jul 17, 2011

Shouldn't the $t be an array? Like it https://gist.github.com/1088066

Shouldn't the $t be an array? Like it https://gist.github.com/1088066

@txus

This comment has been minimized.

Show comment
Hide comment
@txus

txus Jul 18, 2011

thanks, you're totally right! if you want you can do a pull request in the 'a' repo? (http://github.com/txus/a)

Owner

txus commented Jul 18, 2011

thanks, you're totally right! if you want you can do a pull request in the 'a' repo? (http://github.com/txus/a)

@bltavares

This comment has been minimized.

Show comment
Hide comment
@bltavares

bltavares Jul 18, 2011

Sure . I've sent it already (:

Sure . I've sent it already (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment