Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…y test group.
  • Loading branch information...
commit 443ba16928e9adcb803c8186620098593d51e45b 1 parent 18c9139
Bruno Lara Tavares bltavares authored
Showing with 20 additions and 3 deletions.
  1. +17 −0 examples/another_example.rb
  2. +3 −3 lib/a.rb
17 examples/another_example.rb
View
@@ -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
6 lib/a.rb
View
@@ -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=[];
Please sign in to comment.
Something went wrong with that request. Please try again.