test-prof 1.5.0 → 1.5.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: 119118a5840991b0d1bde28e49aca9f3f72f77f89ba57704c53ce2e8a023ad06
4
- data.tar.gz: 6f124770cfeba6346f744dbf66a00b118c6c207711af9f18977abea153de4f7a
3
+ metadata.gz: 2dff1d8ae5206095a30da3b95a68c39df0571bcd7525f8601c2ff0b7ce0b5d06
4
+ data.tar.gz: a67fe77ee1826c220e7afde7e5df026d88c61a2d376134bc858b4a2143a6b883
5
5
  SHA512:
6
- metadata.gz: 6827f8b914ce78da9cabff0dd04ef643c3571e22864a1c6c215028fd4a2e9f79dbbab0d69e7ac9184753460aee96a2202a9201f7bdf2177074b42de47e893ac4
7
- data.tar.gz: 4beacf5a982c0fe64c1c363660f2985be9dd6470ac847eb10e5ef4cd3ddf3360681e8c09fb511d5a99418629b455755e93824768c21520d0c754a908a7e7080c
6
+ metadata.gz: a939c453031278d52fc942f81e712aaafc6959286757a9fdc2680e514f6932488e38da8e2591b4e04aac790088cb109da49a014403f3e67156f31bf4e53b46d2
7
+ data.tar.gz: 43130ba15fbb3f17cb087733c587724185ad849011477424cb2805df9e86cde41c8101d14126b7d0483999f5f08363727b09caabf471b73d85b8652eb2412fb4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 1.5.1 (2026-01-27)
6
+
7
+ - Fix RuboCop plugin. ([@palkan][])
8
+
9
+ Now you should use `--plugin test-prof` or `plugins: [test-prof]` (in YAML) (so LintRoller can correctly obtain the plugin class name from the gemspec).
10
+
5
11
  ## 1.5.0 (2025-12-04)
6
12
 
7
13
  - Logging: support Rails 8.2 structured events based logging. ([@palkan][])
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "test_prof/cops/rspec/language"
3
+ require_relative "../language"
4
4
 
5
5
  module RuboCop
6
6
  module Cop
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "test_prof/cops/rspec/language"
3
+ require_relative "../language"
4
4
 
5
5
  module RuboCop
6
6
  module Cop
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "test_prof/cops/rspec/aggregate_examples/line_range_helpers"
4
- require "test_prof/cops/rspec/aggregate_examples/metadata_helpers"
5
- require "test_prof/cops/rspec/aggregate_examples/node_matchers"
3
+ require_relative "aggregate_examples/line_range_helpers"
4
+ require_relative "aggregate_examples/metadata_helpers"
5
+ require_relative "aggregate_examples/node_matchers"
6
6
 
7
- require "test_prof/cops/rspec/aggregate_examples/its"
8
- require "test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects"
7
+ require_relative "aggregate_examples/its"
8
+ require_relative "aggregate_examples/matchers_with_side_effects"
9
9
 
10
10
  module RuboCop
11
11
  module Cop
@@ -8,8 +8,8 @@ module RuboCop
8
8
  class Plugin < LintRoller::Plugin
9
9
  def about
10
10
  LintRoller::About.new(
11
- name: "test_prof",
12
- version: VERSION,
11
+ name: "test-prof",
12
+ version: ::TestProf::VERSION,
13
13
  homepage: "https://test-prof.evilmartians.io/misc/rubocop",
14
14
  description: "RuboCop plugin to help you write more performant tests."
15
15
  )
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_prof/utils"
4
+ supported = TestProf::Utils.verify_gem_version("rubocop", at_least: "0.51.0")
5
+ unless supported
6
+ warn "TestProf cops require RuboCop >= 0.51.0 to run."
7
+ return
8
+ end
9
+
10
+ require "rubocop/test_prof/plugin"
11
+ require "rubocop/test_prof/cops/rspec/aggregate_examples"
data/lib/test-prof.rb CHANGED
@@ -1,3 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "test_prof"
4
+
5
+ # For RuboCop plugin
6
+ if defined?(RuboCop)
7
+ module RuboCop
8
+ autoload :TestProf, "rubocop/test_prof"
9
+ end
10
+ end
@@ -142,7 +142,7 @@ module TestProf
142
142
  end
143
143
 
144
144
  private def report_duplicates(identifier)
145
- if instance_methods.include?(identifier) && File.basename(__FILE__) == File.basename(instance_method(identifier).source_location[0])
145
+ if method_defined?(identifier) && File.basename(__FILE__) == File.basename(instance_method(identifier).source_location[0])
146
146
  error_msg = "let_it_be(:#{identifier}) was redefined in nested group"
147
147
  report_level = LetItBe.config.report_duplicates.to_sym
148
148
 
@@ -29,7 +29,7 @@ module TestProf
29
29
  .sort_by(&:last)
30
30
  .take(RSpecDissect.config.let_top_count)
31
31
  .each do |(id, size)|
32
- msgs << " ↳ #{id} – #{-size}\n"
32
+ msgs << " ↳ #{id} – #{-size}\n"
33
33
  end
34
34
  msgs.join
35
35
  end
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "test_prof/utils"
4
- supported = TestProf::Utils.verify_gem_version("rubocop", at_least: "0.51.0")
5
- unless supported
6
- warn "TestProf cops require RuboCop >= 0.51.0 to run."
7
- return
8
- end
3
+ warn <<~MSG
4
+ !!!
9
5
 
10
- require "rubocop"
6
+ Please, update your .rubocop.yml configuration to load TestProf plugin as follows (and fix the error below):
11
7
 
12
- require "test_prof/cops/plugin"
13
- require "test_prof/cops/rspec/aggregate_examples"
8
+ plugins:
9
+ - test-prof
10
+
11
+ !!!
12
+
13
+
14
+ MSG
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestProf
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.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.5.0
4
+ version: 1.5.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: 2025-12-04 00:00:00.000000000 Z
11
+ date: 2026-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,6 +123,15 @@ files:
123
123
  - lib/minitest/base_reporter.rb
124
124
  - lib/minitest/event_prof_formatter.rb
125
125
  - lib/minitest/test_prof_plugin.rb
126
+ - lib/rubocop/test_prof.rb
127
+ - lib/rubocop/test_prof/cops/rspec/aggregate_examples.rb
128
+ - lib/rubocop/test_prof/cops/rspec/aggregate_examples/its.rb
129
+ - lib/rubocop/test_prof/cops/rspec/aggregate_examples/line_range_helpers.rb
130
+ - lib/rubocop/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects.rb
131
+ - lib/rubocop/test_prof/cops/rspec/aggregate_examples/metadata_helpers.rb
132
+ - lib/rubocop/test_prof/cops/rspec/aggregate_examples/node_matchers.rb
133
+ - lib/rubocop/test_prof/cops/rspec/language.rb
134
+ - lib/rubocop/test_prof/plugin.rb
126
135
  - lib/test-prof.rb
127
136
  - lib/test_prof.rb
128
137
  - lib/test_prof/any_fixture.rb
@@ -135,14 +144,6 @@ files:
135
144
  - lib/test_prof/before_all.rb
136
145
  - lib/test_prof/before_all/adapters/active_record.rb
137
146
  - lib/test_prof/before_all/isolator.rb
138
- - lib/test_prof/cops/plugin.rb
139
- - lib/test_prof/cops/rspec/aggregate_examples.rb
140
- - lib/test_prof/cops/rspec/aggregate_examples/its.rb
141
- - lib/test_prof/cops/rspec/aggregate_examples/line_range_helpers.rb
142
- - lib/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects.rb
143
- - lib/test_prof/cops/rspec/aggregate_examples/metadata_helpers.rb
144
- - lib/test_prof/cops/rspec/aggregate_examples/node_matchers.rb
145
- - lib/test_prof/cops/rspec/language.rb
146
147
  - lib/test_prof/core.rb
147
148
  - lib/test_prof/event_prof.rb
148
149
  - lib/test_prof/event_prof/custom_events.rb