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: ec0984fc3f7bb4c0e7b38d9f89b75d9f62e75496c9381ef9f8e588a61951360d
4
- data.tar.gz: 861480972fafe20898532edc2ddaff16c51ebe4d9346c7b5d2524d4d83c9b703
3
+ metadata.gz: 7b90214dbde7f85237970ade3e522dfee6cc44b367edc021fdba95820686d2d9
4
+ data.tar.gz: 9719db25e251200e491d45f9094461680e0d2953eb66834f81d0748fa572282d
5
5
  SHA512:
6
- metadata.gz: 3c6d4c9b94b2be6e7f2194554604621c2ce43aa682dc5891ff7c3021821d8f89d2627d45cf90410c51a33478ba343f316cd81ee375be8b091e7b4707c6183646
7
- data.tar.gz: 4ba8a04a33b92b644455ff168b2a3f379412ff4f1df1bb57800875a25911f5281f2fc17c56d9f4c05975503201f45aacef4caa993416eba6e7981bb376032ba9
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
- args = args.map { |a| a == :all ? :each : a }
158
- super(*args, &block)
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.world.reporter.failed_examples.any? ? 1 : 0
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
@@ -3,7 +3,7 @@
3
3
  module Selective
4
4
  module Ruby
5
5
  module RSpec
6
- VERSION = "0.1.7"
6
+ VERSION = "0.1.8"
7
7
  end
8
8
  end
9
9
  end
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.7
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-02-07 00:00:00.000000000 Z
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.4.10
83
+ rubygems_version: 3.5.3
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Selective Ruby RSpec Client