Permalink
Browse files

The test count must reflect the number of test methods called on ever…

…y test group.
  • Loading branch information...
1 parent 18c9139 commit 443ba16928e9adcb803c8186620098593d51e45b @bltavares bltavares committed Jul 18, 2011
Showing with 20 additions and 3 deletions.
  1. +17 −0 examples/another_example.rb
  2. +3 −3 lib/a.rb
View
17 examples/another_example.rb
@@ -0,0 +1,17 @@
+require 'a'
+
+class TestGroup < A
+ def test_falssiness
+ a false == false
+ end
+
+ def teste_nillness
+ a nil == nil
+ end
+end
+
+class MySecondTestCase < A
+ def not_trueliness
+ a true != false
+ end
+end
View
6 lib/a.rb
@@ -1,6 +1,6 @@
-at_exit{$c.map{|t|i=t.new;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\
+at_exit{$c.map{|t|i=t.new;i.setup rescue 0;$t+=t.instance_methods(!0).map{|m|i.\
+send m if !(%w(setup teardown)&[m])[0]};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.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
+c;end;def A.inherited(b);$c<<b;end;end;$n =Time.now;$f =[];$c = [];$a = 0;$t=[];

0 comments on commit 443ba16

Please sign in to comment.