test-prof 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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/test_prof/recipes/rspec/before_all.rb +2 -0
- data/lib/test_prof/recipes/rspec/let_it_be.rb +5 -3
- data/lib/test_prof/ruby_prof.rb +2 -4
- data/lib/test_prof/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7db3f483d344fd783b2438241a2c1498789367740412a66b1586b1ba9a745e0
|
4
|
+
data.tar.gz: a5c652b48e625d0872add68708a544ea9f929af83cd4e802dffdc277d01c2d5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddb20836e08c4488e878b3dc91950f52a812251197b1e1ab697ec3f874d2c9a6ba891fe29bcf8124685ceafa58fa2fe953e873d9f5eff535bf60f55d786d52d6
|
7
|
+
data.tar.gz: f54e9e90d3924a344ae97fe3fed45f976e7e91f8513a6a7190153dadeb215b00fa2c3920ea2903e5553c00e8968964b8119117423d1a2f49d9e0d4232f76f4b9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 1.2.1 (2023-03-22)
|
6
|
+
|
7
|
+
- Fix regression with `before_all(setup_fixtures: true)` and `rspec-rails` v6.0+. ([@palkan][])
|
8
|
+
|
9
|
+
- Upgrade to RubyProf 1.4+. ([@palkan][])
|
10
|
+
|
5
11
|
## 1.2.0 (2023-02-07)
|
6
12
|
|
7
13
|
- Add support for multiple databases to `before_all` / `let_it_be` with Active Record. ([@rutgerw][])
|
@@ -12,6 +12,7 @@ module TestProf
|
|
12
12
|
if within_before_all?
|
13
13
|
before(:all) do
|
14
14
|
@__inspect_output = "before_all hook"
|
15
|
+
::RSpec.current_scope = :before_all if ::RSpec.respond_to?(:current_scope=)
|
15
16
|
instance_eval(&block)
|
16
17
|
end
|
17
18
|
return
|
@@ -22,6 +23,7 @@ module TestProf
|
|
22
23
|
|
23
24
|
before(:all) do
|
24
25
|
@__inspect_output = "before_all hook"
|
26
|
+
::RSpec.current_scope = :before_all if ::RSpec.respond_to?(:current_scope=)
|
25
27
|
BeforeAll.setup_fixtures(self) if setup_fixtures
|
26
28
|
BeforeAll.begin_transaction(context, current_metadata) do
|
27
29
|
instance_eval(&block)
|
@@ -120,11 +120,13 @@ module TestProf
|
|
120
120
|
LetItBe.module_for(self).module_eval do
|
121
121
|
define_method(identifier) do
|
122
122
|
# Trying to detect the context
|
123
|
-
#
|
124
|
-
|
123
|
+
# First, check for ::RSpec.current_scope (modern RSpec) and then read @__inspect_output
|
124
|
+
# (based on https://github.com/rspec/rspec-rails/commit/7cb796db064f58da7790a92e73ab906ef50b1f34)
|
125
|
+
if ::RSpec.respond_to?(:current_scope) && %i[before_all before_context_hook after_context_hook].include?(::RSpec.current_scope)
|
126
|
+
instance_variable_get(:"#{PREFIX}#{identifier}")
|
127
|
+
elsif /(before|after)\(:context\)/.match?(@__inspect_output) || @__inspect_output.include?("before_all")
|
125
128
|
instance_variable_get(:"#{PREFIX}#{identifier}")
|
126
129
|
else
|
127
|
-
# Fallback to let definition
|
128
130
|
super()
|
129
131
|
end
|
130
132
|
end
|
data/lib/test_prof/ruby_prof.rb
CHANGED
@@ -173,9 +173,7 @@ module TestProf
|
|
173
173
|
|
174
174
|
return unless init_ruby_prof
|
175
175
|
|
176
|
-
options = {
|
177
|
-
merge_fibers: true
|
178
|
-
}
|
176
|
+
options = {}
|
179
177
|
|
180
178
|
options[:include_threads] = [Thread.current] unless
|
181
179
|
config.include_threads?
|
@@ -214,7 +212,7 @@ module TestProf
|
|
214
212
|
<<~MSG
|
215
213
|
Please, install 'ruby-prof' first:
|
216
214
|
# Gemfile
|
217
|
-
gem 'ruby-prof', '>=
|
215
|
+
gem 'ruby-prof', '>= 1.4.0', require: false
|
218
216
|
MSG
|
219
217
|
) { check_ruby_prof_version }
|
220
218
|
end
|
data/lib/test_prof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
42
|
+
name: rspec-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '4.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '4.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: isolator
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0'
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.
|
240
|
+
rubygems_version: 3.4.8
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: Ruby applications tests profiling tools
|