fastest 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +12 -1
- data/examples/large_suite_parallel.rb +13 -0
- data/examples/large_suite_serial.rb +12 -0
- data/fastest.gemspec +1 -1
- data/lib/fastest.rb +4 -4
- data/lib/fastest/parallel.rb +2 -0
- metadata +8 -3
data/Readme.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#fastest
|
2
2
|
|
3
3
|
**fastest** is a testing framework written in [6 lines of code](
|
4
|
-
https://github.com/txus/fastest/blob/master/lib/fastest.rb) (or
|
4
|
+
https://github.com/txus/fastest/blob/master/lib/fastest.rb) (or 473 characters)
|
5
5
|
which tries to be performant, with eye-catchy reports and easy to use.
|
6
6
|
|
7
7
|
Originally named **a**, the name was too much for Google so I changed it.
|
@@ -14,6 +14,11 @@ In order to contribute to **fastest**, you have to bear in mind that the code
|
|
14
14
|
**must** stay under 7 lines and with **less than 80 chars** per line. There is
|
15
15
|
room for optimization.
|
16
16
|
|
17
|
+
In case more sophisticated behavior was needed, it could be included as an
|
18
|
+
**optionally loadable addon**. An example of this is [fastest/parallel](
|
19
|
+
https://github.com/txus/fastest/blob/master/lib/fastest/parallel.rb), an addon
|
20
|
+
that enables your tests to run in parallel, which means faster.
|
21
|
+
|
17
22
|
##Features
|
18
23
|
|
19
24
|
* Setup / Teardown
|
@@ -29,11 +34,17 @@ Or in your Gemfile:
|
|
29
34
|
|
30
35
|
gem 'fastest'
|
31
36
|
|
37
|
+
##Addons
|
38
|
+
|
39
|
+
* Require `fastest/parallel` in your test helper or suite to run your tests
|
40
|
+
in parallel.
|
41
|
+
|
32
42
|
##Usage
|
33
43
|
|
34
44
|
````ruby
|
35
45
|
require 'fastest'
|
36
46
|
|
47
|
+
|
37
48
|
# Every test case must inherit from the A class
|
38
49
|
class MyTestCase < A
|
39
50
|
def setup
|
data/fastest.gemspec
CHANGED
data/lib/fastest.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
at_exit{$c.map{|t|i=t.new
|
2
|
-
|
3
|
-
tests, %d assertions, %d failures\n\n%s",Time.now-$n,$t.size,$a,$f.size,$f.\
|
1
|
+
at_exit{$c.map{|t|i=t.new;$t=t.instance_methods(!0).send($r){|m|m=~/^test_/?(i\
|
2
|
+
.setup rescue 0;i.send m;i.teardown rescue 0;1):nil}.compact};printf"\e[0m\n%fs
|
3
|
+
%d tests, %d assertions, %d failures\n\n%s",Time.now-$n,$t.size,$a,$f.size,$f.\
|
4
4
|
map{|f|"\e[1;31mFailure\e[0m \e[97m@\e[33m #{f}\e[0m"}.join(?\n);exit 1 if$f[0]
|
5
5
|
};class A;def a c;$a+=1;print"\e[3"+(c ?"2m.":"1mF");$f<<caller[0]if !c;end;def
|
6
|
-
A.inherited(b);$c<<b;end;end;$n=Time.now;$f=[];$c=[];$a=0;$t=[]
|
6
|
+
A.inherited(b);$c<<b;end;end;$n=Time.now;$f=[];$c=[];$a=0;$t=[];$r='map'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: fastest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0
|
5
|
+
version: 0.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Josep M. Bach
|
@@ -10,7 +10,8 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-02 00:00:00 +02:00
|
14
|
+
default_executable:
|
14
15
|
dependencies: []
|
15
16
|
|
16
17
|
description: th fstst tstng frmwrk.
|
@@ -27,9 +28,13 @@ files:
|
|
27
28
|
- .rvmrc
|
28
29
|
- Readme.md
|
29
30
|
- examples/another_example.rb
|
31
|
+
- examples/large_suite_parallel.rb
|
32
|
+
- examples/large_suite_serial.rb
|
30
33
|
- examples/my_test.rb
|
31
34
|
- fastest.gemspec
|
32
35
|
- lib/fastest.rb
|
36
|
+
- lib/fastest/parallel.rb
|
37
|
+
has_rdoc: true
|
33
38
|
homepage: http://github.com/txus/fastest
|
34
39
|
licenses: []
|
35
40
|
|
@@ -53,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
58
|
requirements: []
|
54
59
|
|
55
60
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.
|
61
|
+
rubygems_version: 1.6.1
|
57
62
|
signing_key:
|
58
63
|
specification_version: 3
|
59
64
|
summary: th fstst tstng frmwrk.
|