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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 762cb1cd173cb06523693291ebd0abeff0608d027606f5a42eb49cb429f0ebb2
4
- data.tar.gz: 704e418622ec41c6dc0df0323ff0de7eb6b072fa71649f54043fb2e38931d3b2
3
+ metadata.gz: c7db3f483d344fd783b2438241a2c1498789367740412a66b1586b1ba9a745e0
4
+ data.tar.gz: a5c652b48e625d0872add68708a544ea9f929af83cd4e802dffdc277d01c2d5f
5
5
  SHA512:
6
- metadata.gz: cd989d5a679bacbd7aaa27faa9d828548de4d2b863c7e62566a6f8b3ac215b9e5fd205ab3dbf1a5cb5f755c7000151e75c7fe7d02735aff6a66b56e314da7925
7
- data.tar.gz: 0e34dc7b6e413eec8a6b6f670458ec5801e9ed9233274effaa5b39920057816ea008a17dd17f3a1dbb641909bad8da1d5253b66e56a67b82a72608addf04646e
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
- # Based on https://github.com/rspec/rspec-rails/commit/7cb796db064f58da7790a92e73ab906ef50b1f34
124
- if /(before|after)\(:context\)/.match?(@__inspect_output) || @__inspect_output.include?("before_all")
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
@@ -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', '>= 0.16.0', require: false
215
+ gem 'ruby-prof', '>= 1.4.0', require: false
218
216
  MSG
219
217
  ) { check_ruby_prof_version }
220
218
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestProf
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
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.0
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-02-08 00:00:00.000000000 Z
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: '3.4'
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: '3.4'
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.3.11
240
+ rubygems_version: 3.4.8
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: Ruby applications tests profiling tools