Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 2 changed files with 20 additions and 3 deletions. Show diff stats Hide diff stats

  1. +17 0 examples/another_example.rb
  2. +3 3 lib/a.rb
17 examples/another_example.rb
... ... @@ -0,0 +1,17 @@
  1 +require 'a'
  2 +
  3 +class TestGroup < A
  4 + def test_falssiness
  5 + a false == false
  6 + end
  7 +
  8 + def teste_nillness
  9 + a nil == nil
  10 + end
  11 +end
  12 +
  13 +class MySecondTestCase < A
  14 + def not_trueliness
  15 + a true != false
  16 + end
  17 +end
6 lib/a.rb
... ... @@ -1,6 +1,6 @@
1   -at_exit{$c.map{|t|i=t.new;i.setup rescue 0;$t=t.instance_methods(!0).map{|m|i.\
2   -send m if !(%w(setup teardown)&[m])[0]}.compact;i.teardown rescue 0};printf"\e\
  1 +at_exit{$c.map{|t|i=t.new;i.setup rescue 0;$t+=t.instance_methods(!0).map{|m|i.\
  2 +send m if !(%w(setup teardown)&[m])[0]};i.teardown rescue 0};printf"\e\
3 3 [0m\n%fs\n%d tests, %d assertions, %d failures\n\n%s",Time.now-$n,$t.size,$a,$f
4 4 .size,$f.map{|f|"\e[1;31mFailure\e[0m \e[97m@\e[33m #{f}\e[0m"}.join(?\n);exit\
5 5 1 if$f[0]};class A;def a c;$a+=1;print"\e[3"+(c ?"2m.":"1mF");$f<<caller[0]if !
6   -c;end;def A.inherited(b);$c<<b;end;end; $n = Time.now; $f = []; $c = []; $a = 0
  6 +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.
Something went wrong with that request. Please try again.