selective-ruby-rspec 0.1.12 → 0.1.13
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 238f5bcf12278f31375b5ec8aa214b5c481f51950e937150456282e32403da2c
|
|
4
|
+
data.tar.gz: ed0b17ea2bd15e77415452f35ba220bb300ab4ef415fce39ae13e0eaaa125b04
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 283f02c6092c1f098e6e773a48ac4a3d5b96ad435e229e02d571e87d8c85ef24ce4f68e097ac1f0cff18fd23e03ded321907ad87f17c3cdaf0a6a2a5052b417b
|
|
7
|
+
data.tar.gz: c1d52ca30661f273f15201bb33a2f038d231ed5e16e6e80661d948a73f6b781332c8c81289d769eada9fc2e164f6665e6e347af1356b379e43bab2fb16aedee8
|
|
@@ -49,7 +49,9 @@ module Selective
|
|
|
49
49
|
def run_test_cases(test_case_ids)
|
|
50
50
|
ensure_test_phase
|
|
51
51
|
configure(test_case_ids)
|
|
52
|
-
|
|
52
|
+
groups = optimize_test_filtering(test_case_ids).to_a
|
|
53
|
+
reset_group_memoization(groups)
|
|
54
|
+
rspec_runner.run_specs(groups)
|
|
53
55
|
if connection_lost
|
|
54
56
|
self.connection_lost = false
|
|
55
57
|
raise Selective::Ruby::Core::ConnectionLostError
|
|
@@ -108,7 +110,7 @@ module Selective
|
|
|
108
110
|
private
|
|
109
111
|
|
|
110
112
|
def parse_args(args)
|
|
111
|
-
supported_wrapper_args = %w[--require-each-hooks]
|
|
113
|
+
supported_wrapper_args = %w[--require-each-hooks --preserve-all-hooks]
|
|
112
114
|
wrapper_args, rspec_args = args.partition do |arg|
|
|
113
115
|
supported_wrapper_args.any? do |p|
|
|
114
116
|
arg.start_with?(p)
|
|
@@ -147,14 +149,25 @@ module Selective
|
|
|
147
149
|
|
|
148
150
|
def failure_formatter(example)
|
|
149
151
|
presenter = ::RSpec::Core::Formatters::ExceptionPresenter::Factory.new(example).build
|
|
152
|
+
message_lines = presenter.message_lines
|
|
153
|
+
message_lines = multiple_exception_lines(presenter) if message_lines.empty?
|
|
150
154
|
|
|
151
155
|
{
|
|
152
|
-
failure_message_lines:
|
|
156
|
+
failure_message_lines: message_lines,
|
|
153
157
|
failure_formatted_backtrace: presenter.formatted_backtrace
|
|
154
158
|
# failure_full_backtrace: example.exception.backtrace
|
|
155
159
|
}
|
|
156
160
|
end
|
|
157
161
|
|
|
162
|
+
# RSpec keeps the detail of a MultipleExceptionError (aggregate_failures,
|
|
163
|
+
# or an example and a hook both failing) only in its fully formatted output.
|
|
164
|
+
def multiple_exception_lines(presenter)
|
|
165
|
+
lines = presenter.fully_formatted_lines(nil, ::RSpec::Core::Notifications::NullColorizer).map(&:to_s)
|
|
166
|
+
lines = lines.drop_while { |line| line.strip.empty? }
|
|
167
|
+
lines = lines.drop(1) if presenter.description && lines.first&.strip == presenter.description.to_s.strip
|
|
168
|
+
lines.map { |line| line.sub(/\A /, "") }
|
|
169
|
+
end
|
|
170
|
+
|
|
158
171
|
def apply_rspec_configuration
|
|
159
172
|
::RSpec.configure do |config|
|
|
160
173
|
config.backtrace_exclusion_patterns = config.backtrace_exclusion_patterns | [/lib\/selective/]
|
|
@@ -190,6 +203,13 @@ module Selective
|
|
|
190
203
|
end
|
|
191
204
|
end
|
|
192
205
|
|
|
206
|
+
# RSpec memoizes descendant_filtered_examples per group and decides from it
|
|
207
|
+
# whether to run before(:all)/after(:all); a stale value from an earlier
|
|
208
|
+
# batch skips a group's context hooks.
|
|
209
|
+
def reset_group_memoization(top_level_groups)
|
|
210
|
+
top_level_groups.each { |group| group.descendants.each(&:reset_memoized) }
|
|
211
|
+
end
|
|
212
|
+
|
|
193
213
|
def ensure_test_phase
|
|
194
214
|
@test_phase_initialized ||= begin
|
|
195
215
|
::RSpec.world.reporter.send(:start, nil)
|
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.13
|
|
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: 2026-11-
|
|
12
|
+
date: 2026-11-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: zeitwerk
|