minitest-heat 2.1.0 → 2.2.0

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: 854fe8325934b81a7dd330ce67af14e20789a9233f33296bf3bd9b794c4dac20
4
- data.tar.gz: 835c33a68c9efc7f92a9baca779b3844310a74e527f6553f4f12be2967d0691a
3
+ metadata.gz: de79ea86107b9d5183d3353e2c4cf6b8f5f61601080e781c611f305a4e192afd
4
+ data.tar.gz: b3deddb67ef5fd2b069d2f3fe3edd754cb91df9322390dfdbe7845cab4ab73a0
5
5
  SHA512:
6
- metadata.gz: 030dace3e842475ef5dbeb7c108909ec1faed7d4cc0a2a9219704992908a29d2c6320d21e66fce4229960aea2f4538ab33af493bd10d3f6e70e3fcc0910c0504
7
- data.tar.gz: 828f273f9e7961f17c4b3a6d35ba6fa4fd020d3075e600e656bbebbb9d8975990e13d6536aec5eb2defb5d2784d4786d3988aa264a27c449230f2723eeedb363
6
+ metadata.gz: ce4bf462ee43dba7da46d8455caecb242f97c03a596af283c3627d50236562eca481bc6a1fbffa025b48ecfb91692c2d2a527a9a1c55603e241335256aa20b27
7
+ data.tar.gz: d80070c1d120c17a4fb700980b0107b506c3046ac19463e5e89e9fa0e8ca0e3b614adde6426f1a001c6ef1492df6ce3c33af9a11d95cd63495be5eb064e26808
data/.flayignore ADDED
@@ -0,0 +1 @@
1
+ ./test/**/*.rb
@@ -27,11 +27,21 @@ jobs:
27
27
  run: bundle exec bundle-audit check
28
28
 
29
29
  test:
30
- name: Test (Ruby ${{ matrix.ruby }})
30
+ name: Test (Ruby ${{ matrix.ruby }}, Minitest ${{ matrix.minitest }})
31
31
  strategy:
32
32
  fail-fast: false
33
33
  matrix:
34
34
  ruby: ['3.2', '3.3', '3.4', '4.0']
35
+ minitest: ['~> 5.0', '~> 6.0']
36
+ include:
37
+ - ruby: '3.2'
38
+ minitest: '= 5.22.3'
39
+ - ruby: '3.2'
40
+ minitest: '= 6.0.0'
41
+ env:
42
+ MINITEST_VERSION: ${{ matrix.minitest }}
43
+ BUNDLE_FROZEN: 'false'
44
+ BUNDLE_DEPLOYMENT: 'false'
35
45
  runs-on: ubuntu-latest
36
46
  steps:
37
47
  - uses: actions/checkout@v4
@@ -40,10 +50,37 @@ jobs:
40
50
  with:
41
51
  ruby-version: ${{ matrix.ruby }}
42
52
  bundler: '2.7.2'
43
- bundler-cache: true
53
+ bundler-cache: false
54
+ - name: Resolve selected Minitest
55
+ run: |
56
+ bundle lock --update minitest
57
+ bundle install
58
+ - name: Verify selected Minitest
59
+ run: |
60
+ bundle exec ruby -rminitest -e '
61
+ version = Gem.loaded_specs.fetch("minitest").version
62
+ abort "Wrong Minitest: #{version}" unless Gem::Requirement.new(ENV.fetch("MINITEST_VERSION")).satisfied_by?(version)
63
+ puts "Ruby #{RUBY_VERSION}, Minitest #{version}"
64
+ '
44
65
  - name: Run tests
45
66
  run: bundle exec rake test
46
67
 
68
+ required-tests:
69
+ # Keep the names required by the repository rules while gating on every
70
+ # supported Ruby/Minitest combination, including the version boundaries.
71
+ name: Test (Ruby ${{ matrix.ruby }})
72
+ needs: test
73
+ if: ${{ always() }}
74
+ strategy:
75
+ matrix:
76
+ ruby: ['3.2', '3.3', '3.4', '4.0']
77
+ runs-on: ubuntu-latest
78
+ env:
79
+ TEST_RESULT: ${{ needs.test.result }}
80
+ steps:
81
+ - name: Require the complete compatibility matrix to pass
82
+ run: test "$TEST_RESULT" = success
83
+
47
84
  changelog:
48
85
  name: Changelog
49
86
  runs-on: ubuntu-latest
data/.reek.yml ADDED
@@ -0,0 +1,87 @@
1
+ # Reek configuration for minitest-heat
2
+ # https://github.com/troessner/reek/blob/master/docs/defaults.reek.yml
3
+
4
+ detectors:
5
+ # --- Disabled: conflicts with standard Ruby patterns ---
6
+
7
+ # Flags attr_accessor as a writable attribute. Standard Ruby; no value suppressing.
8
+ Attribute:
9
+ enabled: false
10
+
11
+ # Flags keyword arguments like `clear_screen: false`. Idiomatic Ruby.
12
+ BooleanParameter:
13
+ enabled: false
14
+
15
+ # Flags branching on method arguments. Appropriate for configuration and options.
16
+ ControlParameter:
17
+ enabled: false
18
+
19
+ # Issue#initialize wraps Minitest::Result data — all parameters are necessary.
20
+ # Map#add takes pathname, line_number, type, and backtrace — all distinct inputs.
21
+ LongParameterList:
22
+ max_params: 4
23
+ exclude:
24
+ - 'Minitest::Heat::Issue#initialize'
25
+
26
+ # --- Threshold adjustments: defaults are too aggressive ---
27
+
28
+ # Default max_calls (1) flags every repeated method call. Raise to 3 so only
29
+ # genuine duplication is flagged, not incidental reuse.
30
+ DuplicateMethodCall:
31
+ max_calls: 3
32
+
33
+ # Guard clauses like `file_exists?` and mode checks like `json_output?` are
34
+ # repeated across public methods by design, not duplication.
35
+ RepeatedConditional:
36
+ enabled: false
37
+
38
+ # Default max_statements (5) flags nearly every non-trivial method. 12 keeps
39
+ # the check useful while allowing token-building methods that are linear and clear.
40
+ TooManyStatements:
41
+ max_statements: 12
42
+
43
+ # Location is a comprehensive value object with many accessors.
44
+ # 30 keeps the check useful for genuinely bloated classes.
45
+ TooManyMethods:
46
+ max_methods: 30
47
+
48
+ # Flags nil checks (`nil?`, `!x`). Legitimate for optional settings and
49
+ # backtrace data where nil is a normal value.
50
+ NilCheck:
51
+ enabled: false
52
+
53
+ # Output classes format data from domain objects — accessing their attributes
54
+ # is the entire purpose, not a design flaw.
55
+ FeatureEnvy:
56
+ enabled: false
57
+
58
+ # Flags private methods that don't reference instance state. These methods
59
+ # logically belong to their class even without direct instance access.
60
+ UtilityFunction:
61
+ enabled: false
62
+
63
+ # ManualDispatch is legitimate for duck-typing checks (respond_to? + send).
64
+ ManualDispatch:
65
+ enabled: false
66
+
67
+ # Nested iterators are common in token-building code where lines contain tokens.
68
+ # Two levels deep is readable and appropriate for this codebase.
69
+ NestedIterators:
70
+ max_allowed_nesting: 2
71
+
72
+ # Issue wraps a Minitest::Result with classification; 9 ivars reflect the data it needs.
73
+ # Source has 5 ivars for file reading context — all necessary.
74
+ TooManyInstanceVariables:
75
+ max_instance_variables: 9
76
+
77
+ # Timer.start! and Timer.stop! are mutating operations with no safe equivalent.
78
+ # The bang convention here signals state mutation, not a safe/unsafe pair.
79
+ MissingSafeMethod:
80
+ enabled: false
81
+
82
+ # RuboCop enforces `e` for rescue variables (Naming/RescuedExceptionsVariableName).
83
+ # Allow `e` to avoid conflicts between the two tools.
84
+ UncommunicativeVariableName:
85
+ accept:
86
+ - e
87
+ - i
data/.reviewer.yml ADDED
@@ -0,0 +1,87 @@
1
+ ---
2
+ # Review gem dependencies for security issues
3
+ bundle_audit:
4
+ name: Bundle Audit
5
+ description: Review gem dependencies for security issues
6
+ tags: [security, dependencies, ruby]
7
+ commands:
8
+ install: bundle exec gem install bundler-audit
9
+ prepare: bundle exec bundle-audit update
10
+ review: bundle exec bundle-audit check --no-update
11
+
12
+ # Review Ruby syntax and formatting for consistency
13
+ rubocop:
14
+ name: RuboCop
15
+ description: Review Ruby syntax and formatting for consistency
16
+ tags: [ruby, syntax]
17
+ commands:
18
+ install: bundle exec gem install rubocop
19
+ review: bundle exec rubocop --parallel
20
+ format: bundle exec rubocop --auto-correct
21
+ files:
22
+ flag: ''
23
+ separator: ' '
24
+ pattern: '*.rb'
25
+
26
+ # Examine Ruby classes for code smells
27
+ reek:
28
+ disabled: true
29
+ name: Reek
30
+ description: Examine Ruby classes for code smells
31
+ tags: [ruby, quality]
32
+ links:
33
+ home: https://github.com/troessner/reek
34
+ install: https://github.com/troessner/reek#quickstart
35
+ max_exit_status: 2
36
+ commands:
37
+ install: bundle exec gem install reek
38
+ review: bundle exec reek --config .reek.yml lib/
39
+ files:
40
+ flag: ''
41
+ separator: ' '
42
+ pattern: '*.rb'
43
+
44
+ # Reports most tortured ruby code in a pain report
45
+ flog:
46
+ disabled: true
47
+ name: Flog
48
+ description: Reports your most tortured ruby code in an easy to read pain report.
49
+ tags: [ruby, quality]
50
+ links:
51
+ home: https://ruby.sadi.st/Flog.html
52
+ install: https://ruby.sadi.st/Flog.html
53
+ commands:
54
+ install: bundle exec gem install flog
55
+ review: bundle exec flog -g lib
56
+ flags:
57
+ threshold: 10
58
+ group:
59
+ methods-only:
60
+
61
+ # Review ruby code for structural similarities
62
+ flay:
63
+ disabled: true
64
+ name: Flay
65
+ description: Review ruby code for structural similarities and refactoring opportunities.
66
+ tags: [ruby, quality]
67
+ links:
68
+ home: https://ruby.sadi.st/Flay.html
69
+ install: https://ruby.sadi.st/Flay.html
70
+ commands:
71
+ install: bundle exec gem install flay
72
+ review: bundle exec flay ./lib
73
+ flags:
74
+ liberal:
75
+ summary:
76
+
77
+ # Unit tests and coverage
78
+ tests:
79
+ name: Minitest
80
+ description: Unit tests and coverage
81
+ tags: [ruby, tests]
82
+ commands:
83
+ review: bundle exec rake test
84
+ files:
85
+ review: bundle exec ruby -Itest
86
+ pattern: '*_test.rb'
87
+ map_to_tests: minitest
@@ -0,0 +1,42 @@
1
+ ---
2
+ :bundle_audit:
3
+ :last_status: :passed
4
+ :last_prepared_at: '2026-02-01 10:15:13 -0700'
5
+ bundle exec bundle-audit update:
6
+ - 0.94
7
+ bundle exec bundle-audit check --no-update:
8
+ - 0.2
9
+ - 0.15
10
+ - 0.23
11
+ - 0.21
12
+ - 0.29
13
+ :last_failed_files:
14
+ :rubocop:
15
+ :last_status: :passed
16
+ :last_failed_files:
17
+ bundle exec rubocop --parallel:
18
+ - 1.4
19
+ - 1.11
20
+ - 1.76
21
+ :tests:
22
+ :last_status: :passed
23
+ :last_failed_files:
24
+ bundle exec rake test:
25
+ - 0.54
26
+ - 0.5
27
+ - 0.66
28
+ :reek:
29
+ :last_status: :passed
30
+ :last_failed_files:
31
+ bundle exec reek --config .reek.yml lib/:
32
+ - 0.91
33
+ :flog:
34
+ :last_status: :passed
35
+ :last_failed_files:
36
+ bundle exec flog -g lib --threshold 10 --group --methods-only:
37
+ - 0.38
38
+ :flay:
39
+ :last_status: :passed
40
+ :last_failed_files:
41
+ bundle exec flay ./lib --liberal --summary:
42
+ - 0.36
data/.rubocop.yml CHANGED
@@ -7,14 +7,26 @@ AllCops:
7
7
  Exclude:
8
8
  - 'bin/**/*'
9
9
  - 'test/files/source.rb' # An example test file for reading source code
10
+ - 'test/minitest/contrived_*' # Intentional failures for testing the reporter
10
11
 
11
12
  # Let's aim for 80, but we don't need to be nagged if we judiciously go over.
12
13
  Layout/LineLength:
13
14
  Enabled: false
14
15
 
15
- # One case statement in a single method isn't complex.
16
+ # One case statement in a single method isn't complex. Issue classification
17
+ # methods use cascading conditionals that are clear and linear.
16
18
  Metrics/CyclomaticComplexity:
17
- AllowedMethods: ['case']
19
+ AllowedMethods: ['case', 'type', 'issue_label']
20
+
21
+ # Issue#initialize wraps Minitest::Result with keyword args — all are needed.
22
+ # build_issue test helper mirrors those parameters.
23
+ Metrics/ParameterLists:
24
+ CountKeywordArgs: false
25
+
26
+ # Classification and token-building methods are linear with many branches.
27
+ # 20 is reasonable for this codebase.
28
+ Metrics/AbcSize:
29
+ Max: 20
18
30
 
19
31
  # Development dependencies in gemspec is fine for this gem
20
32
  Gemspec/DevelopmentDependencies:
@@ -25,5 +37,24 @@ Metrics/MethodLength:
25
37
  CountAsOne: ['array', 'hash', 'heredoc']
26
38
  Max: 15
27
39
 
40
+ # Test classes naturally grow with coverage (see test/.rubocop.yml for higher limit)
41
+ Metrics/ClassLength:
42
+ CountAsOne: ['array', 'hash', 'heredoc']
43
+ Max: 150
44
+
45
+ Metrics/ModuleLength:
46
+ CountAsOne: ['array', 'hash', 'heredoc']
47
+ Max: 150
48
+
49
+ # Fasterer prefers yield over block.call for performance
50
+ Style/ExplicitBlockArgument:
51
+ Enabled: false
52
+
53
+ # Fasterer prefers fetch with block over second argument for performance
54
+ Style/RedundantFetchBlock:
55
+ Enabled: false
56
+
57
+ # Compact style (Minitest::Heat::IssueTest) is standard for this project.
58
+ # Nested style breaks when intermediary names are classes, not modules (e.g. Backtrace).
28
59
  Style/ClassAndModuleChildren:
29
60
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.2.0] - 2026-09-16
4
+
5
+ ### Added
6
+ - Support Minitest 6 with explicit plugin activation (`Minitest.load :heat`) and compatible test filtering, while retaining automatic discovery on Minitest 5.
7
+
8
+ ### Changed
9
+ - Require Minitest `>= 5.22.3, < 7` and test both major versions in CI. Applications using older Minitest versions must upgrade Minitest before upgrading Heat.
10
+
11
+ ### Fixed
12
+ - Install only one Heat reporter when the plugin is loaded repeatedly, preserving valid JSON output.
13
+ - Normalize relative result paths so test exceptions retain their classification and failure locations when invoked with relative filenames.
14
+ - Return an unsuccessful exit status when Heat cannot record a result, and keep JSON output valid by sending reporter diagnostics to stderr.
15
+ - Return an unsuccessful exit status when an explicit test filter matches no tests, consistent with Minitest; unfiltered empty runs remain successful.
16
+ - Preserve namespaced method names and handle current Ruby quoting in backtrace details.
17
+ - Tests classified as broken now cause an unsuccessful process exit instead of incorrectly reporting success to test runners and CI.
18
+ - JSON output explicitly loads the time library so timestamp formatting works on Ruby 3.2 and 3.3 without relying on another dependency to load it.
19
+ - Updated locked development dependencies for security advisories affecting concurrent-ruby, erb, and json.
20
+
21
+ ## [2.1.1] - 2026-02-01
22
+
23
+ ### Changed
24
+ - Converted ~90 single-expression methods to Ruby 3.0+ endless method syntax
25
+ - Moved dev dependencies from gemspec to Gemfile; changed `add_runtime_dependency` to `add_dependency`
26
+ - Moved constants above `private` in Output::Token for conventional ordering
27
+ - Replaced inline rubocop disables with targeted reek annotations
28
+ - Switched to leading-dot method chains, symbol-to-proc where applicable, and minor style fixes
29
+ - Removed unnecessary `begin`/`end` block in Output#print_tokens rescue
30
+ - Cleaned up test suite: removed redundant tests, fixed silent-pass conditionals, replaced fragile mutation-based setup with fresh instances, added ensure-based cleanup for filesystem tests
31
+
3
32
  ## [2.1.0] - 2026-01-30
4
33
 
5
34
  ### Added
data/Gemfile CHANGED
@@ -2,9 +2,21 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- # Specify your gem's dependencies in minitest-heat.gemspec
5
+ # Runtime dependencies in minitest-heat.gemspec
6
6
  gemspec
7
7
 
8
+ gem 'minitest', ENV.fetch('MINITEST_VERSION') if ENV['MINITEST_VERSION']
9
+
10
+ # Development dependencies
8
11
  gem 'bundler-audit', '>= 0.9'
9
- gem 'minitest', '~> 5.0'
12
+ gem 'debug'
13
+ gem 'flay'
14
+ gem 'flog'
10
15
  gem 'rake', '>= 13.0'
16
+ gem 'reek'
17
+ gem 'reviewer'
18
+ gem 'rubocop'
19
+ gem 'rubocop-minitest'
20
+ gem 'rubocop-rake'
21
+ gem 'simplecov'
22
+ gem 'simplecov_json_formatter'
data/Gemfile.lock CHANGED
@@ -1,36 +1,78 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-heat (2.1.0)
5
- minitest
4
+ minitest-heat (2.2.0)
5
+ minitest (>= 5.22.3, < 7)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.3)
11
- awesome_print (1.9.2)
11
+ bigdecimal (4.0.1)
12
12
  bundler-audit (0.9.3)
13
13
  bundler (>= 1.2.0)
14
14
  thor (~> 1.0)
15
+ concurrent-ruby (1.3.8)
15
16
  date (3.5.1)
16
17
  debug (1.11.1)
17
18
  irb (~> 1.10)
18
19
  reline (>= 0.3.8)
19
20
  docile (1.4.1)
20
- erb (6.0.1)
21
+ dry-configurable (1.3.0)
22
+ dry-core (~> 1.1)
23
+ zeitwerk (~> 2.6)
24
+ dry-core (1.2.0)
25
+ concurrent-ruby (~> 1.0)
26
+ logger
27
+ zeitwerk (~> 2.6)
28
+ dry-inflector (1.3.1)
29
+ dry-initializer (3.2.0)
30
+ dry-logic (1.6.0)
31
+ bigdecimal
32
+ concurrent-ruby (~> 1.0)
33
+ dry-core (~> 1.1)
34
+ zeitwerk (~> 2.6)
35
+ dry-schema (1.15.0)
36
+ concurrent-ruby (~> 1.0)
37
+ dry-configurable (~> 1.0, >= 1.0.1)
38
+ dry-core (~> 1.1)
39
+ dry-initializer (~> 3.2)
40
+ dry-logic (~> 1.6)
41
+ dry-types (~> 1.8)
42
+ zeitwerk (~> 2.6)
43
+ dry-types (1.9.0)
44
+ bigdecimal (>= 3.0)
45
+ concurrent-ruby (~> 1.0)
46
+ dry-core (~> 1.0)
47
+ dry-inflector (~> 1.0)
48
+ dry-logic (~> 1.4)
49
+ zeitwerk (~> 2.6)
50
+ erb (6.0.7)
51
+ erubi (1.13.1)
52
+ flay (2.14.2)
53
+ erubi (~> 1.10)
54
+ path_expander (~> 2.0)
55
+ prism (~> 1.7)
56
+ sexp_processor (~> 4.0)
57
+ flog (4.9.4)
58
+ path_expander (~> 2.0)
59
+ prism (~> 1.7)
60
+ sexp_processor (~> 4.8)
21
61
  io-console (0.8.2)
22
62
  irb (1.16.0)
23
63
  pp (>= 0.6.0)
24
64
  rdoc (>= 4.0.0)
25
65
  reline (>= 0.4.2)
26
- json (2.18.0)
66
+ json (2.21.2)
27
67
  language_server-protocol (3.17.0.5)
28
68
  lint_roller (1.1.0)
69
+ logger (1.7.0)
29
70
  minitest (5.27.0)
30
71
  parallel (1.27.0)
31
72
  parser (3.3.10.1)
32
73
  ast (~> 2.4.1)
33
74
  racc
75
+ path_expander (2.0.1)
34
76
  pp (0.6.3)
35
77
  prettyprint
36
78
  prettyprint (0.2.0)
@@ -45,9 +87,19 @@ GEM
45
87
  erb
46
88
  psych (>= 4.0.0)
47
89
  tsort
90
+ reek (6.5.0)
91
+ dry-schema (~> 1.13)
92
+ logger (~> 1.6)
93
+ parser (~> 3.3.0)
94
+ rainbow (>= 2.0, < 4.0)
95
+ rexml (~> 3.1)
48
96
  regexp_parser (2.11.3)
49
97
  reline (0.6.3)
50
98
  io-console (~> 0.5)
99
+ reviewer (0.1.5)
100
+ rainbow
101
+ slop
102
+ rexml (3.4.4)
51
103
  rubocop (1.84.0)
52
104
  json (~> 2.3)
53
105
  language_server-protocol (~> 3.17.0.2)
@@ -70,30 +122,35 @@ GEM
70
122
  lint_roller (~> 1.1)
71
123
  rubocop (>= 1.72.1)
72
124
  ruby-progressbar (1.13.0)
125
+ sexp_processor (4.17.5)
73
126
  simplecov (0.22.0)
74
127
  docile (~> 1.1)
75
128
  simplecov-html (~> 0.11)
76
129
  simplecov_json_formatter (~> 0.1)
77
130
  simplecov-html (0.13.2)
78
131
  simplecov_json_formatter (0.1.4)
132
+ slop (4.10.1)
79
133
  stringio (3.2.0)
80
134
  thor (1.5.0)
81
135
  tsort (0.2.0)
82
136
  unicode-display_width (3.2.0)
83
137
  unicode-emoji (~> 4.1)
84
138
  unicode-emoji (4.2.0)
139
+ zeitwerk (2.7.4)
85
140
 
86
141
  PLATFORMS
87
142
  arm64-darwin-24
88
143
  ruby
89
144
 
90
145
  DEPENDENCIES
91
- awesome_print
92
146
  bundler-audit (>= 0.9)
93
147
  debug
94
- minitest (~> 5.0)
148
+ flay
149
+ flog
95
150
  minitest-heat!
96
151
  rake (>= 13.0)
152
+ reek
153
+ reviewer
97
154
  rubocop
98
155
  rubocop-minitest
99
156
  rubocop-rake
data/README.md CHANGED
@@ -20,12 +20,22 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install minitest-heat
22
22
 
23
- And depending on your usage, you may need to require Minitest Heat in your test suite:
23
+ Heat supports Ruby 3.2 and newer with Minitest `>= 5.22.3, < 7`.
24
+
25
+ Minitest 5 discovers Heat automatically when the gem is available and plugin loading
26
+ is enabled. Existing Minitest 5 setups do not need to change.
27
+
28
+ Minitest 6 requires explicit plugin activation. Add this to your `test_helper.rb`:
24
29
 
25
30
  ```ruby
26
- require 'minitest/heat'
31
+ require 'minitest/autorun'
32
+ Minitest.load :heat
27
33
  ```
28
34
 
35
+ `require 'minitest/heat'` loads Heat's library and configuration API; it does not
36
+ activate the reporter on Minitest 6. Loading the Heat plugin more than once installs
37
+ only one reporter.
38
+
29
39
  ## Prioritizing Your Work
30
40
 
31
41
  Minitest Heat surfaces the most impactful problems first so you can fix what matters without scrolling through noise.
@@ -145,6 +155,24 @@ FORCE_SLOWS=true # No errors or skipped tests, just slow tests
145
155
 
146
156
  So to see the full context of a test suite, `IMPLODE=true bundle exec rake` will work its magic.
147
157
 
158
+ ### Testing Minitest compatibility
159
+
160
+ The development lockfile retains Minitest 5.27.0. To select another supported version
161
+ in a disposable checkout, use the same runner as CI:
162
+
163
+ ```sh
164
+ export MINITEST_VERSION='~> 6.0'
165
+ export BUNDLE_FROZEN=false BUNDLE_DEPLOYMENT=false
166
+ bundle lock --update minitest
167
+ bundle install
168
+ CI=true bundle exec rake test
169
+ ```
170
+
171
+ Use `~> 5.0` for the latest Minitest 5, or `= 5.22.3` / `= 6.0.0` for the supported
172
+ boundaries. These commands update that checkout's lockfile; do not commit those
173
+ version-selection changes. CI tests the latest 5.x and 6.x on Ruby 3.2–4.0 and both
174
+ Minitest boundaries on Ruby 3.2. All compatibility jobs must pass before release.
175
+
148
176
  ## Contributing
149
177
  Bug reports and pull requests are welcome on GitHub at https://github.com/garrettdimon/minitest-heat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/minitest-heat/blob/master/CODE_OF_CONDUCT.md).
150
178
 
data/favicon.svg ADDED
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
2
+ <text y="0.9em" font-size="90">🔥</text>
3
+ </svg>
@@ -15,7 +15,7 @@ module Minitest
15
15
  end
16
16
 
17
17
  def earliest_project_location
18
- locations.rindex { |element| element.project_file? }
18
+ locations.rindex(&:project_file?)
19
19
  end
20
20
 
21
21
  def max_location
@@ -12,8 +12,8 @@ module Minitest
12
12
  def self.read(raw_text)
13
13
  return nil if raw_text.nil? || raw_text.empty?
14
14
 
15
- raw_pathname, raw_line_number, raw_container = raw_text.to_s.split(':')
16
- raw_container = raw_container&.delete_prefix('in `')&.delete_suffix("'")
15
+ raw_pathname, raw_line_number, raw_container = raw_text.to_s.split(':', 3)
16
+ raw_container = raw_container&.sub(/\Ain [`']/, '')&.delete_suffix("'")
17
17
 
18
18
  ::Minitest::Heat::Location.new(
19
19
  pathname: raw_pathname,
@@ -21,9 +21,7 @@ module Minitest
21
21
  # Determines if the raw backtrace has values in it
22
22
  #
23
23
  # @return [Boolean] true if there's no backtrace or it's empty
24
- def empty?
25
- raw_backtrace.empty?
26
- end
24
+ def empty? = raw_backtrace.empty?
27
25
 
28
26
  # All lines of the backtrace converted to Backtrace::LineParser's
29
27
  #
@@ -38,30 +36,22 @@ module Minitest
38
36
  # files at the beginning
39
37
  #
40
38
  # @return [Array<Location>] the sorted backtrace lines from the project
41
- def recently_modified_locations
42
- @recently_modified_locations ||= project_locations.sort_by(&:mtime).reverse
43
- end
39
+ def recently_modified_locations = (@recently_modified_locations ||= project_locations.sort_by(&:mtime).reverse)
44
40
 
45
41
  # All entries from the backtrace that are files within the project
46
42
  #
47
43
  # @return [Array<Location>] the backtrace lines from within the project
48
- def project_locations
49
- @project_locations ||= locations.select(&:project_file?)
50
- end
44
+ def project_locations = (@project_locations ||= locations.select(&:project_file?))
51
45
 
52
46
  # All entries from the backtrace within the project tests
53
47
  #
54
48
  # @return [Array<Location>] the backtrace lines from within the tests
55
- def test_locations
56
- @test_locations ||= project_locations.select(&:test_file?)
57
- end
49
+ def test_locations = (@test_locations ||= project_locations.select(&:test_file?))
58
50
 
59
51
  # All source code entries from the backtrace (i.e. excluding tests)
60
52
  #
61
53
  # @return [Array<Location>] the backtrace lines from within the source code
62
- def source_code_locations
63
- @source_code_locations ||= project_locations.select(&:source_code_file?)
64
- end
54
+ def source_code_locations = (@source_code_locations ||= project_locations.select(&:source_code_file?))
65
55
  end
66
56
  end
67
57
  end