selective-ruby-rspec 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b90214dbde7f85237970ade3e522dfee6cc44b367edc021fdba95820686d2d9
|
4
|
+
data.tar.gz: 9719db25e251200e491d45f9094461680e0d2953eb66834f81d0748fa572282d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7690d0daabbc30d2ec52a7b82dd061bc0586a1226d30ac2989327c6bd73dcb8632c0c939e8a6b76b6e2654b9b1c2cfe21ba576a7c575eb015ebedd1b68aa0b
|
7
|
+
data.tar.gz: 6f25414691962aa6f07d40f97495469137c719796c999be8c785890d072a33959bed73f8e9c9577b1ff7c2ded44141afc1d609b475df40681ad1758d3d5fd0c1
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'benchmark'
|
2
|
+
|
1
3
|
module Selective
|
2
4
|
module Ruby
|
3
5
|
module RSpec
|
@@ -154,8 +156,20 @@ module Selective
|
|
154
156
|
module Hooks
|
155
157
|
HOOKS.each do |hook|
|
156
158
|
define_method(hook) do |*args, &block|
|
157
|
-
|
158
|
-
|
159
|
+
if args.any? { |a| a == :all}
|
160
|
+
args = args.map { |a| a == :all ? :each : a }
|
161
|
+
super(*args, &->(example) {
|
162
|
+
Benchmark.measure { example.instance_exec(example, &block) }.tap do |time|
|
163
|
+
Selective::Ruby::Core::Controller.report_at_finish.tap do |report_at_finish|
|
164
|
+
key = :"seconds_in_#{hook}_all_hooks"
|
165
|
+
report_at_finish[key] ||= 0
|
166
|
+
report_at_finish[key] += time.real
|
167
|
+
end
|
168
|
+
end
|
169
|
+
})
|
170
|
+
else
|
171
|
+
super(*args, &block)
|
172
|
+
end
|
159
173
|
end
|
160
174
|
end
|
161
175
|
end
|
@@ -75,7 +75,13 @@ module Selective
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def exit_status
|
78
|
-
::RSpec.
|
78
|
+
if Gem::Version.new(::RSpec::Core::Version::STRING) >= Gem::Version.new("3.10")
|
79
|
+
rspec_runner.exit_code(::RSpec.world.reporter.failed_examples.none?)
|
80
|
+
else
|
81
|
+
return ::RSpec.world.reporter.exit_early(rspec_runner.configuration.failure_exit_code) if ::RSpec.world.wants_to_quit
|
82
|
+
|
83
|
+
::RSpec.world.reporter.failed_examples.any? ? 1 : 0
|
84
|
+
end
|
79
85
|
end
|
80
86
|
|
81
87
|
def finish
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selective-ruby-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Wood
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: zeitwerk
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
83
|
+
rubygems_version: 3.5.3
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Selective Ruby RSpec Client
|