Permalink
Browse files

tweak last pull request

  • Loading branch information...
1 parent 443ba16 commit 996f7e03c828ac91a726d3c534699a59498f0824 @txus committed Jul 19, 2011
Showing with 15 additions and 8 deletions.
  1. +4 −2 examples/another_example.rb
  2. +5 −0 examples/my_test.rb
  3. +6 −6 lib/a.rb
@@ -1,11 +1,13 @@
+$: << 'lib'
+
require 'a'
class TestGroup < A
- def test_falssiness
+ def test_falsiness
a false == false
end
- def teste_nillness
+ def test_nilness
a nil == nil
end
end
View
@@ -12,6 +12,11 @@ def test_user_has_property
a !@user[:other]
end
+ def test_user_has_another_property
+ a @user[:some] == :object
+ a !@user[:other]
+ end
+
def teardown
@user = nil
end
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]};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;$t=[];
+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.\
+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=[]

0 comments on commit 996f7e0

Please sign in to comment.