cutest 1.2.0 → 1.2.1
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.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +9 -0
- data/README.markdown +21 -13
- data/bin/cutest +3 -1
- data/cutest.gemspec +6 -11
- data/lib/cutest.rb +5 -3
- data/test/run.rb +11 -0
- metadata +15 -13
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ODJmODdlMjVmNTZhZTU5Y2FhMDVlNDUxOWViMGIyZWE5YmM4MDIzYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MGQ4MzFkMzA4MTY3MDZkNTA0NjEyYzlkNWFkNGFkNzMxYjUzNTFiMg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDU3ZjczMzczOGVjMGYxN2YzMDA0NjVmNWNlMWFlMWQ0OGZkMjM2OGM3N2Mz
|
10
|
+
ZTMzOTc0OWFlZWZkZmEwOTg5YTdhZTMyYjhjZDhmN2NmNDUwOGM0N2Y2MjJi
|
11
|
+
YWY3ZTVlMTQyMDgzYWRkMDBlNjAxMjljMjU5YWExNTRlNWI1ZDI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTY4NDQxMmJiYTg2Y2QyOTc3MGQ3MGNiMWRkN2JkYzc0NTNmMWIwM2E2ZWY2
|
14
|
+
ZjhiZDhjZTJlYTk4MTRkOWZkNTdkY2E4NmZkOTI1ZGQ4NjE0NTdhNmY3ZmMy
|
15
|
+
ZTA0MzlhYjAyYmQxZDdlYWYwYTZjN2MzYTIwMGZlYzRiM2JhYzQ=
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/pkg
|
data/CHANGELOG.md
ADDED
data/README.markdown
CHANGED
@@ -41,17 +41,7 @@ exception to the expected one. In all cases, if the expectation is no met, an
|
|
41
41
|
Usage
|
42
42
|
-----
|
43
43
|
|
44
|
-
In your
|
45
|
-
|
46
|
-
require "cutest"
|
47
|
-
|
48
|
-
task :test do
|
49
|
-
Cutest.run(Dir["test/*.rb"])
|
50
|
-
end
|
51
|
-
|
52
|
-
task :default => :test
|
53
|
-
|
54
|
-
Or from the command line:
|
44
|
+
In your terminal:
|
55
45
|
|
56
46
|
$ cutest test/*.rb
|
57
47
|
|
@@ -116,14 +106,32 @@ If you get an error when running the tests, this is what you will see:
|
|
116
106
|
Exception: assert_equal 24, params[:a] # 24 != 23
|
117
107
|
test/setup.rb +14
|
118
108
|
|
119
|
-
|
109
|
+
Running the build
|
110
|
+
-----------------
|
111
|
+
|
112
|
+
Using Rake:
|
113
|
+
|
114
|
+
task :test do
|
115
|
+
exec "cutest test/*.rb"
|
116
|
+
end
|
117
|
+
|
118
|
+
task :default => :test
|
119
|
+
|
120
|
+
Using Make:
|
121
|
+
|
122
|
+
.PHONY: test
|
123
|
+
|
124
|
+
test:
|
125
|
+
cutest test/*.rb
|
126
|
+
|
127
|
+
Command-line interface
|
120
128
|
----------------------
|
121
129
|
|
122
130
|
The tool `cutest` accepts a list of files and sends them to `Cutest.run`. If
|
123
131
|
you need to require a file or library before running the tests, as is the case
|
124
132
|
with test helpers, use the `-r` flag:
|
125
133
|
|
126
|
-
$ cutest -r test/helper.rb test/*_test.rb
|
134
|
+
$ cutest -r ./test/helper.rb ./test/*_test.rb
|
127
135
|
|
128
136
|
If you want to check which version you are running, try the `-v` flag.
|
129
137
|
|
data/bin/cutest
CHANGED
data/cutest.gemspec
CHANGED
@@ -5,18 +5,13 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.version = Cutest::VERSION
|
6
6
|
s.summary = "Forking tests."
|
7
7
|
s.description = "Run tests in separate processes to avoid shared state."
|
8
|
-
s.authors = ["Damian Janowski", "Michel Martens"]
|
9
|
-
s.email = ["djanowski@dimaion.com", "michel@soveran.com"]
|
10
|
-
s.homepage = "
|
8
|
+
s.authors = ["Damian Janowski", "Michel Martens", "Cyril David"]
|
9
|
+
s.email = ["djanowski@dimaion.com", "michel@soveran.com", "me@cyrildavid.com"]
|
10
|
+
s.homepage = "https://github.com/djanowski/cutest"
|
11
11
|
|
12
|
-
s.
|
13
|
-
|
14
|
-
|
15
|
-
"Rakefile",
|
16
|
-
"lib/**/*.rb",
|
17
|
-
"*.gemspec",
|
18
|
-
"test/**/*.*"
|
19
|
-
]
|
12
|
+
s.license = "MIT"
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
20
15
|
|
21
16
|
s.executables.push "cutest"
|
22
17
|
end
|
data/lib/cutest.rb
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
class Cutest
|
2
2
|
unless defined?(VERSION)
|
3
|
-
VERSION = "1.2.
|
3
|
+
VERSION = "1.2.1"
|
4
4
|
FILTER = %r[/(ruby|jruby|rbx)[-/]([0-9\.])+]
|
5
5
|
CACHE = Hash.new { |h, k| h[k] = File.readlines(k) }
|
6
6
|
end
|
7
7
|
|
8
8
|
def self.run(files)
|
9
|
-
files.
|
9
|
+
status = files.all? do |file|
|
10
10
|
run_file(file)
|
11
11
|
|
12
12
|
Process.wait
|
13
13
|
|
14
|
-
|
14
|
+
$?.success?
|
15
15
|
end
|
16
16
|
|
17
17
|
puts
|
18
|
+
|
19
|
+
status
|
18
20
|
end
|
19
21
|
|
20
22
|
def self.run_file(file)
|
data/test/run.rb
CHANGED
@@ -6,6 +6,11 @@ test "output of successful run" do
|
|
6
6
|
assert_equal(expected, out)
|
7
7
|
end
|
8
8
|
|
9
|
+
test "exit code of successful run" do
|
10
|
+
%x{./bin/cutest test/fixtures/success.rb}
|
11
|
+
assert_equal 0, $?.to_i
|
12
|
+
end
|
13
|
+
|
9
14
|
test "output of failed run" do
|
10
15
|
expected = "\n" +
|
11
16
|
" test: failed assertion\n" +
|
@@ -30,6 +35,12 @@ test "output of failed run" do
|
|
30
35
|
assert_equal(expected, out)
|
31
36
|
end
|
32
37
|
|
38
|
+
test "exit code of failed run" do
|
39
|
+
%x{./bin/cutest test/fixtures/failure.rb}
|
40
|
+
|
41
|
+
assert $?.to_i != 0
|
42
|
+
end
|
43
|
+
|
33
44
|
test "output of custom assertion" do
|
34
45
|
expected = "\n" +
|
35
46
|
" test: failed custom assertion\n" +
|
metadata
CHANGED
@@ -1,32 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Damian Janowski
|
9
8
|
- Michel Martens
|
9
|
+
- Cyril David
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Run tests in separate processes to avoid shared state.
|
16
16
|
email:
|
17
17
|
- djanowski@dimaion.com
|
18
18
|
- michel@soveran.com
|
19
|
+
- me@cyrildavid.com
|
19
20
|
executables:
|
20
21
|
- cutest
|
21
22
|
extensions: []
|
22
23
|
extra_rdoc_files: []
|
23
24
|
files:
|
25
|
+
- .gitignore
|
26
|
+
- CHANGELOG.md
|
24
27
|
- LICENSE
|
25
28
|
- README.markdown
|
26
29
|
- Rakefile
|
27
|
-
-
|
28
|
-
- lib/cutest.rb
|
30
|
+
- bin/cutest
|
29
31
|
- cutest.gemspec
|
32
|
+
- lib/cutest.rb
|
33
|
+
- lib/cutest/vendor/clap.rb
|
30
34
|
- test/assert.rb
|
31
35
|
- test/assert_equal.rb
|
32
36
|
- test/assert_raise.rb
|
@@ -39,30 +43,28 @@ files:
|
|
39
43
|
- test/run.rb
|
40
44
|
- test/scopes.rb
|
41
45
|
- test/setup.rb
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
homepage: https://github.com/djanowski/cutest
|
47
|
+
licenses:
|
48
|
+
- MIT
|
49
|
+
metadata: {}
|
46
50
|
post_install_message:
|
47
51
|
rdoc_options: []
|
48
52
|
require_paths:
|
49
53
|
- lib
|
50
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
55
|
requirements:
|
53
56
|
- - ! '>='
|
54
57
|
- !ruby/object:Gem::Version
|
55
58
|
version: '0'
|
56
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
60
|
requirements:
|
59
61
|
- - ! '>='
|
60
62
|
- !ruby/object:Gem::Version
|
61
63
|
version: '0'
|
62
64
|
requirements: []
|
63
65
|
rubyforge_project:
|
64
|
-
rubygems_version:
|
66
|
+
rubygems_version: 2.0.0
|
65
67
|
signing_key:
|
66
|
-
specification_version:
|
68
|
+
specification_version: 4
|
67
69
|
summary: Forking tests.
|
68
70
|
test_files: []
|