minitest-reporters 0.14.4 → 0.14.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/minitest/around_test_hooks.rb +10 -14
- data/lib/minitest/reporters.rb +5 -13
- data/lib/minitest/reporters/version.rb +1 -1
- metadata +4 -4
@@ -1,21 +1,17 @@
|
|
1
1
|
module MiniTest
|
2
2
|
module AroundTestHooks
|
3
|
-
def self.
|
4
|
-
|
3
|
+
def self.included(base)
|
4
|
+
base.instance_eval do
|
5
|
+
alias_method :run_without_hooks, :run
|
6
|
+
alias_method :run, :run_with_hooks
|
7
|
+
end
|
5
8
|
end
|
6
9
|
|
7
|
-
def
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
AroundTestHooks.before_test(self)
|
13
|
-
super
|
14
|
-
end
|
15
|
-
|
16
|
-
def after_teardown
|
17
|
-
super
|
18
|
-
AroundTestHooks.after_test(self)
|
10
|
+
def run_with_hooks(runner)
|
11
|
+
runner.before_test(self.class, self.__name__)
|
12
|
+
run_without_hooks(runner)
|
13
|
+
ensure
|
14
|
+
runner.after_test(self.class, self.__name__)
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
data/lib/minitest/reporters.rb
CHANGED
@@ -22,7 +22,7 @@ module MiniTest
|
|
22
22
|
|
23
23
|
def self.use!(console_reporters = ProgressReporter.new, env = ENV, backtrace_filter = ExtensibleBacktraceFilter.default_filter)
|
24
24
|
use_runner!(console_reporters, env)
|
25
|
-
|
25
|
+
use_around_test_hooks!
|
26
26
|
use_backtrace_filter!(backtrace_filter)
|
27
27
|
use_parallel_length_method!
|
28
28
|
end
|
@@ -33,18 +33,8 @@ module MiniTest
|
|
33
33
|
Unit.runner = runner
|
34
34
|
end
|
35
35
|
|
36
|
-
def self.
|
37
|
-
|
38
|
-
Unit::TestCase.send(:include, AroundTestHooks)
|
39
|
-
else
|
40
|
-
Unit::TestCase.send(:define_method, :before_setup) do
|
41
|
-
AroundTestHooks.before_test(self)
|
42
|
-
end
|
43
|
-
|
44
|
-
Unit::TestCase.send(:define_method, :after_teardown) do
|
45
|
-
AroundTestHooks.after_test(self)
|
46
|
-
end
|
47
|
-
end
|
36
|
+
def self.use_around_test_hooks!
|
37
|
+
Unit::TestCase.send(:include, AroundTestHooks)
|
48
38
|
end
|
49
39
|
|
50
40
|
def self.use_backtrace_filter!(backtrace_filter)
|
@@ -75,6 +65,8 @@ module MiniTest
|
|
75
65
|
|
76
66
|
def self.use_parallel_length_method!
|
77
67
|
if Unit::VERSION >= "4.2.0"
|
68
|
+
require "minitest/parallel_each"
|
69
|
+
|
78
70
|
ParallelEach.send(:define_method, :length) do
|
79
71
|
@queue.length
|
80
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-reporters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -164,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
segments:
|
166
166
|
- 0
|
167
|
-
hash:
|
167
|
+
hash: -2644503825152626631
|
168
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
169
|
none: false
|
170
170
|
requirements:
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
segments:
|
175
175
|
- 0
|
176
|
-
hash:
|
176
|
+
hash: -2644503825152626631
|
177
177
|
requirements: []
|
178
178
|
rubyforge_project: minitest-reporters
|
179
179
|
rubygems_version: 1.8.24
|