a-gem 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Readme.md +4 -2
- data/a.gemspec +1 -1
- data/lib/a.rb +6 -6
- metadata +1 -1
data/Readme.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#a
|
|
2
2
|
|
|
3
3
|
**a** is a testing framework written in [6 lines of code](
|
|
4
|
-
https://github.com/txus/a/blob/master/lib/a.rb) (or
|
|
4
|
+
https://github.com/txus/a/blob/master/lib/a.rb) (or 478 characters) which
|
|
5
5
|
tries to be performant, with eye-catchy reports and easy to use.
|
|
6
6
|
|
|
7
7
|
Heavily inspired by Konstantin Haase's [almost-sinatra](
|
|
@@ -69,7 +69,7 @@ end
|
|
|
69
69
|
|
|
70
70
|
And voilà:
|
|
71
71
|
|
|
72
|
-

|
|
73
73
|
|
|
74
74
|
##Disclaimer
|
|
75
75
|
|
|
@@ -81,3 +81,5 @@ itself.
|
|
|
81
81
|
|
|
82
82
|
Copyright (c) 2011 Josep M. Bach. Released under the MIT license.
|
|
83
83
|
|
|
84
|
+
|
|
85
|
+
|
data/a.gemspec
CHANGED
data/lib/a.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
$n=Time.now;$f=[];$
|
|
2
|
-
<<caller[0];"\e[31mF\e[0m");end;def self.inherited(b);$
|
|
3
|
-
.map{|t|i=t.new;i.setup rescue nil
|
|
4
|
-
if !%w(setup teardown).include? m};i.teardown rescue nil};print "\n#{
|
|
5
|
-
|
|
6
|
-
"\e[31mFailure\e[0m \e[97m@\e[33m #{f}"}.join("\n")
|
|
1
|
+
$n=Time.now;$f=[];$c=[];$a=0;class A;def a c;$a+=1;print c ?"\e[32m.\e[0m":($f\
|
|
2
|
+
<<caller[0];"\e[31mF\e[0m");end;def self.inherited(b);$c<<b;end;end;at_exit{$c\
|
|
3
|
+
.map{|t|i=t.new;i.setup rescue nil;$t=t.instance_methods(false).map{|m|i.send\
|
|
4
|
+
m if !%w(setup teardown).include? m}.compact;i.teardown rescue nil};print "\n#{
|
|
5
|
+
Time.now-$n} s.\n#{$t.size} tests, #{$a} assertions, #{$f.size} failures\n\n"+
|
|
6
|
+
$f.map{|f|"\e[31mFailure\e[0m \e[97m@\e[33m #{f}"}.join("\n");exit -1 if $f[0]}
|