minitest 5.14.4 → 5.25.5
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
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +283 -2
- data/Manifest.txt +5 -0
- data/README.rdoc +78 -36
- data/Rakefile +8 -1
- data/lib/hoe/minitest.rb +2 -5
- data/lib/minitest/assertions.rb +131 -83
- data/lib/minitest/autorun.rb +0 -7
- data/lib/minitest/benchmark.rb +11 -14
- data/lib/minitest/compress.rb +94 -0
- data/lib/minitest/error_on_warning.rb +11 -0
- data/lib/minitest/expectations.rb +18 -0
- data/lib/minitest/manual_plugins.rb +16 -0
- data/lib/minitest/mock.rb +148 -45
- data/lib/minitest/parallel.rb +5 -5
- data/lib/minitest/pride_plugin.rb +17 -24
- data/lib/minitest/spec.rb +20 -12
- data/lib/minitest/test.rb +51 -34
- data/lib/minitest/test_task.rb +307 -0
- data/lib/minitest/unit.rb +5 -8
- data/lib/minitest.rb +333 -154
- data/test/minitest/metametameta.rb +33 -19
- data/test/minitest/test_minitest_assertions.rb +292 -147
- data/test/minitest/test_minitest_benchmark.rb +3 -3
- data/test/minitest/test_minitest_mock.rb +396 -62
- data/test/minitest/test_minitest_reporter.rb +169 -32
- data/test/minitest/test_minitest_spec.rb +174 -72
- data/test/minitest/test_minitest_test.rb +420 -130
- data/test/minitest/test_minitest_test_task.rb +57 -0
- data.tar.gz.sig +0 -0
- metadata +23 -20
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2ea23b9f86dd37b5f5f3d45fb451303827cbdf9414215d8f769da3624184325
|
4
|
+
data.tar.gz: 3d976e8b864261af92ba50d466235e4fa529f31d3560d60ec4deba8e724fc872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1258d24412b8461fe9a94acb9b795a1cd2a25db2d16f924ce6367662478d9e0672532636b5a2ccd809f549ba8ba6ab8f0cbeb6e8a249b1b91161cc4297f31c92
|
7
|
+
data.tar.gz: 4d6a977e948f40d05e7786d07656616e9f3a4e4469a59e7b5a8e571b8f6821284989156ca4225e8e7a29cfe640bbaf544248697e14536f7c63946ffc2a34232e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,284 @@
|
|
1
|
+
=== 5.25.5 / 2025-03-12
|
2
|
+
|
3
|
+
* 4 bug fixes:
|
4
|
+
|
5
|
+
* Bumped minimum ruby to 2.7.
|
6
|
+
* Fixed expectation docs for must/wont_pattern_match. (jaredcwhite)
|
7
|
+
* Reorder Minitest::Test.ancestors to allow reaching Minitest::Assertions#skipped? (Edouard-chin)
|
8
|
+
* Update the ruby and rails compatibility tables. (bquorning)
|
9
|
+
|
10
|
+
=== 5.25.4 / 2024-12-03
|
11
|
+
|
12
|
+
* 1 bug fix:
|
13
|
+
|
14
|
+
* Fix for must_verify definition if only requiring minitest/mock (but why?).
|
15
|
+
|
16
|
+
=== 5.25.3 / 2024-12-03
|
17
|
+
|
18
|
+
* 5 bug fixes:
|
19
|
+
|
20
|
+
* Fixed assert_mock to fail instead of raise on unmet mock expectations.
|
21
|
+
* Fixed assert_mock to take an optional message argument.
|
22
|
+
* Fixed formatting of unmet mock expectation messages.
|
23
|
+
* Fixed missing must_verify expectation to match assert_mock.
|
24
|
+
* minitest/pride: Fixed to use true colors with *-direct terminals (bk2204)
|
25
|
+
|
26
|
+
=== 5.25.2 / 2024-11-21
|
27
|
+
|
28
|
+
* 4 bug fixes:
|
29
|
+
|
30
|
+
* Include class name in spec name. (thomasmarshall)
|
31
|
+
* Fixed 'redefining object_id' warning from ruby 3.4. (mattbrictson)
|
32
|
+
* Minitest top-level namespace no longer includes entire contents of README.rdoc. Too much!
|
33
|
+
* Refactored spec's describe to more cleanly determine the superclass and name
|
34
|
+
|
35
|
+
=== 5.25.1 / 2024-08-16
|
36
|
+
|
37
|
+
* 2 bug fixes:
|
38
|
+
|
39
|
+
* Fix incompatibility caused by minitest-hooks & rails invading minitest internals.
|
40
|
+
* Revert change from =~ to match? to allow for nil if $TERM undefined.
|
41
|
+
|
42
|
+
=== 5.25.0 / 2024-08-13
|
43
|
+
|
44
|
+
* 2 minor enhancements:
|
45
|
+
|
46
|
+
* Fixed some inefficiencies filtering and matching (mostly backtraces).
|
47
|
+
* Refactored siginfo handler to reduce runtime costs. Saved ~30%!
|
48
|
+
|
49
|
+
* 5 bug fixes:
|
50
|
+
|
51
|
+
* Added missing rdoc to get back to 100% coverage.
|
52
|
+
* Cleaning up ancient code checking for defined?(Encoding) and the like.
|
53
|
+
* Disambiguated some shadowed variables in minitest/compress.
|
54
|
+
* Fixed an ironic bug if using string-literals AND Werror.
|
55
|
+
* Improve description of test:slow task. (stomar)
|
56
|
+
|
57
|
+
=== 5.24.1 / 2024-06-29
|
58
|
+
|
59
|
+
* 1 bug fix:
|
60
|
+
|
61
|
+
* Fix the error message when an extension is invalid value. (y-yagi)
|
62
|
+
|
63
|
+
=== 5.24.0 / 2024-06-18
|
64
|
+
|
65
|
+
* 2 minor enhancements:
|
66
|
+
|
67
|
+
* Added Minitest.register_plugin.
|
68
|
+
* Extended plugin system to work with modules/classes for opt-out plugins.
|
69
|
+
|
70
|
+
* 1 bug fix:
|
71
|
+
|
72
|
+
* Removed anacronism, but allow load_plugins to exit gracefully if --disable=gems.
|
73
|
+
|
74
|
+
=== 5.23.1 / 2024-05-21
|
75
|
+
|
76
|
+
* 1 bug fix:
|
77
|
+
|
78
|
+
* Fully qualify the Queue class to avoid conflicts with other libraries. (rafaelfranca)
|
79
|
+
|
80
|
+
=== 5.23.0 / 2024-05-15
|
81
|
+
|
82
|
+
* 3 minor enhancements:
|
83
|
+
|
84
|
+
* Added -Werror to raise on any warning output. (byroot)
|
85
|
+
* Added UnexpectedWarning as a failure summary type, added count to output if activated.
|
86
|
+
* Added minitest/manual_plugins.rb w/ new Minitest.load method. (tenderlove)
|
87
|
+
|
88
|
+
* 2 bug fixes:
|
89
|
+
|
90
|
+
* Allow empty_run! and reporter to display summary for empty runs. (zzak)
|
91
|
+
* Make test task verbose using either rake's -v or -t (was just -t).
|
92
|
+
|
93
|
+
=== 5.22.3 / 2024-03-13
|
94
|
+
|
95
|
+
* 1 minor enhancement:
|
96
|
+
|
97
|
+
* MASSIVE improvement of minitest's pride plugin output: Frequencies doubled! Sine waves shifted!! Comments improved!!! Colors rotated!!!! (havenwood)
|
98
|
+
|
99
|
+
* 3 bug fixes:
|
100
|
+
|
101
|
+
* Improved wording on Minitest::Test#parallelize_me! to clarify it goes INSIDE your test class/describe.
|
102
|
+
* Minor changes to tests to pass when tests ran with extra flags (eg -p).
|
103
|
+
* Support Ruby 3.4's new error message format. (mame)
|
104
|
+
|
105
|
+
=== 5.22.2 / 2024-02-07
|
106
|
+
|
107
|
+
* 1 bug fix:
|
108
|
+
|
109
|
+
* Third time's a charm? Remember: 'ensure' is almost always the
|
110
|
+
wrong way to go (for results... it's great for cleaning up).
|
111
|
+
|
112
|
+
=== 5.22.1 / 2024-02-06
|
113
|
+
|
114
|
+
* 1 bug fix:
|
115
|
+
|
116
|
+
* Don't exit non-zero if no tests ran and no filter (aka, the test file is empty).
|
117
|
+
(I'm starting to think the exit 1 thing for @tenderlove was a mistake...)
|
118
|
+
|
119
|
+
=== 5.22.0 / 2024-02-05
|
120
|
+
|
121
|
+
* 1 minor enhancement:
|
122
|
+
|
123
|
+
* Added "did you mean" output if your --name filter matches nothing. (tenderlove)
|
124
|
+
|
125
|
+
* 2 bug fixes:
|
126
|
+
|
127
|
+
* Big cleanup of test filtering. Much prettier / more functional.
|
128
|
+
* Fix situation where Assertion#location can't find the location. (pftg)
|
129
|
+
|
130
|
+
=== 5.21.2 / 2024-01-17
|
131
|
+
|
132
|
+
* 1 bug fix:
|
133
|
+
|
134
|
+
* Fixed bug in Minitest::Compress#compress formatting w/ nested patterns. Now recurses properly.
|
135
|
+
|
136
|
+
=== 5.21.1 / 2024-01-11
|
137
|
+
|
138
|
+
* 1 bug fix:
|
139
|
+
|
140
|
+
* Rails' default backtrace filter can't currently work with caller_locations, so reverting back to caller.
|
141
|
+
|
142
|
+
=== 5.21.0 / 2024-01-11
|
143
|
+
|
144
|
+
* 10 minor enhancements:
|
145
|
+
|
146
|
+
* Add include_all kw arg to assert_respond_to and refute_respond_to.
|
147
|
+
* Added --quiet flag to skip ProgressReporter (prints the dots). Minor speedup.
|
148
|
+
* Added Minitest::Compress#compress and added it to UnexpectedError.
|
149
|
+
* Added ability to initialize BacktraceFilter w/ custom regexp.
|
150
|
+
* Filter failure backtraces using backtrace_filter before calculating location. (thomasmarshall)
|
151
|
+
* Make BacktraceFilter#filter compatible with locations (still compares strings).
|
152
|
+
* Optimized Assertion#location ~30%.
|
153
|
+
* Output relative paths for all failures/errors/backtraces.
|
154
|
+
* Refactored location information in assertions, now using locations.
|
155
|
+
* Removed thread and mutex_m dependencies. (hsbt, eregon)
|
156
|
+
|
157
|
+
* 2 bug fixes:
|
158
|
+
|
159
|
+
* Drop undocumented bt arg in #skip. Dunno why that ever happened, prolly for testing?
|
160
|
+
* Fix mock to work with ruby debugger enabled. (keithlayne)
|
161
|
+
|
162
|
+
=== 5.20.0 / 2023-09-06
|
163
|
+
|
164
|
+
* 1 minor enhancement:
|
165
|
+
|
166
|
+
* Optionally allow autorun exit hook to remain active in forked child. (casperisfine)
|
167
|
+
|
168
|
+
=== 5.19.0 / 2023-07-26
|
169
|
+
|
170
|
+
* 2 minor enhancements:
|
171
|
+
|
172
|
+
* Add metadata lazy accessor to Runnable / Result. (matteeyah)
|
173
|
+
* Only load minitest/unit (aka ancient MiniTest compatibility layer) if \ENV[\"MT_COMPAT\"]
|
174
|
+
|
175
|
+
* 1 bug fix:
|
176
|
+
|
177
|
+
* Minitest::TestTask enthusiastically added itself to default. (ParadoxV5)
|
178
|
+
|
179
|
+
=== 5.18.1 / 2023-06-16
|
180
|
+
|
181
|
+
* 3 bug fixes:
|
182
|
+
|
183
|
+
* Avoid extra string allocations when filtering tests. (tenderlove)
|
184
|
+
* Only mention deprecated \ENV[\'N\'] if it is an integer string.
|
185
|
+
* Push up test_order to Minitest::Runnable to fix minitest/hell. (koic)
|
186
|
+
|
187
|
+
=== 5.18.0 / 2023-03-04
|
188
|
+
|
189
|
+
* 2 major enhancements:
|
190
|
+
|
191
|
+
* Added assert_pattern & refute_pattern for pattern matching. (flavorjones)
|
192
|
+
* Added matching must_pattern_match & wont_pattern_match to minitest/spec.
|
193
|
+
|
194
|
+
* 1 bug fix:
|
195
|
+
|
196
|
+
* Support the new message format of NameError in Ruby 3.3 (mame)
|
197
|
+
|
198
|
+
=== 5.17.0 / 2022-12-31
|
199
|
+
|
200
|
+
* 1 minor enhancement:
|
201
|
+
|
202
|
+
* Refactor setup hooks into a SETUP_METHODS constant. (MSP-Greg)
|
203
|
+
|
204
|
+
* 3 bug fixes:
|
205
|
+
|
206
|
+
* Fix kwargs for Mock calls to delegator. (blowmage)
|
207
|
+
* Fix kwargs for expectations. (bobmazanec, blowmage)
|
208
|
+
* Remove check for .b method. (tenderlove)
|
209
|
+
|
210
|
+
=== 5.16.3 / 2022-08-17
|
211
|
+
|
212
|
+
* 2 bug fixes:
|
213
|
+
|
214
|
+
* Fixed exception sanitization by removing TypeError restriction on rescue.
|
215
|
+
* Use A instead of deprecated TESTOPTS in rake test:slow. (davidstosik)
|
216
|
+
|
217
|
+
=== 5.16.2 / 2022-07-03
|
218
|
+
|
219
|
+
* 4 bug fixes:
|
220
|
+
|
221
|
+
* Added MT_KWARGS_HACK kludge for stub to deal with ruby 2.7 kwargs nastiness. (tsugimoto)
|
222
|
+
* In #expect, pop Hash class from args if $MT_KWARGS_HACK. (casperisfine)
|
223
|
+
* In above scenario, set expected kwargs (as Objects) based on actual kwargs.
|
224
|
+
* Nuke ivars if exception fails to marshal twice (eg better_errors). (irphilli)
|
225
|
+
|
226
|
+
=== 5.16.1 / 2022-06-20
|
227
|
+
|
228
|
+
* 2 bug fixes:
|
229
|
+
|
230
|
+
* Apparently adding real kwarg support to mocks/stubs broke some code. Fixed.
|
231
|
+
* Use `MT_KWARGS_HACK=1` to activate the kludgy kwargs support w/ caveats.
|
232
|
+
* Clarified some doco wrt the block on #stub.
|
233
|
+
|
234
|
+
=== 5.16.0 / 2022-06-14
|
235
|
+
|
236
|
+
* 2 major enhancements:
|
237
|
+
|
238
|
+
* Added Minitest::TestTask.
|
239
|
+
* Dropping ruby 2.2 - 2.5. 2.6 is DTM soon too.
|
240
|
+
|
241
|
+
* 11 minor enhancements:
|
242
|
+
|
243
|
+
* Added --show-skips option to show skips at end of run but not require --verbose. (MSP-Greg)
|
244
|
+
* Added Minitest.seed, the random seed used by the run.
|
245
|
+
* Calling `srand Minitest.seed` before all shuffles to ensure determinism.
|
246
|
+
* Extended #stub to handle kwargs for both block and call args. (SampsonCrowley)
|
247
|
+
* Extended Mock#__call to display kwargs.
|
248
|
+
* Extended Mock#expect to record kwargs.
|
249
|
+
* Extended Mock#method_missing to take kwargs & compare them against expected.
|
250
|
+
* Mock#method_missing displays better errors on arity mismatch.
|
251
|
+
* Removed minor optimization removing empty suites before run.
|
252
|
+
* Simplified test randomization (test order will change even with fixed seed).
|
253
|
+
* assert_match now returns the MatchData on success. (Nakilon)
|
254
|
+
|
255
|
+
* 3 bug fixes:
|
256
|
+
|
257
|
+
* (Re)Fixed marshalling of exceptions, neutering them in 2 passes.
|
258
|
+
* Fixed more problems with rdoc.
|
259
|
+
* Had to patch up mock and stub to deal with <=2.7 kwargs oddities
|
260
|
+
|
261
|
+
=== 5.15.0 / 2021-12-14
|
262
|
+
|
263
|
+
* 1 major enhancement:
|
264
|
+
|
265
|
+
* assert_throws returns the value returned, if any. (volmer)
|
266
|
+
|
267
|
+
* 3 minor enhancements:
|
268
|
+
|
269
|
+
* Added -S <CODES> option to skip reporting of certain types of output
|
270
|
+
* Enable Ruby deprecation warnings by default. (casperisfine)
|
271
|
+
* Use Etc.nprocessors by default in order to maximize cpu usage. (tonytonyjan)
|
272
|
+
|
273
|
+
* 6 bug fixes:
|
274
|
+
|
275
|
+
* Close then unlink tempfiles on Windows. (nobu)
|
276
|
+
* Fixed #skip_until for windows paths. (MSP-Greg)
|
277
|
+
* Fixed a bunch of tests for jruby and windows. (MSP-Greg)
|
278
|
+
* Fixed marshalling of specs if they error. (tenderlove, jeremyevans, et al)
|
279
|
+
* Updated deprecation message for block expectations. (blowmage)
|
280
|
+
* Use Kernel.warn directly in expectations in case CUT defines their own warn. (firien)
|
281
|
+
|
1
282
|
=== 5.14.4 / 2021-02-23
|
2
283
|
|
3
284
|
* 1 bug fix:
|
@@ -94,7 +375,7 @@
|
|
94
375
|
|
95
376
|
* 3 bug fixes:
|
96
377
|
|
97
|
-
* Check
|
378
|
+
* Check \option[:filter] klass before match. Fixes 2.6 warning. (y-yagi)
|
98
379
|
* Fixed Assertions#diff from recalculating if set to nil
|
99
380
|
* Fixed spec section of readme to not use deprecated global expectations. (CheezItMan)
|
100
381
|
|
@@ -561,7 +842,7 @@ Minitest 5:
|
|
561
842
|
* Added Minitest::Benchmark.
|
562
843
|
* Your benchmarks need to move to their own subclass.
|
563
844
|
* Benchmarks using the spec DSL have to have "Bench" somewhere in their describe.
|
564
|
-
* MiniTest::Unit.after_tests moved to Minitest.
|
845
|
+
* MiniTest::Unit.after_tests moved to Minitest.after_run
|
565
846
|
* MiniTest::Unit.autorun is now Minitest.autorun. Just require minitest/autorun pls.
|
566
847
|
* Removed ParallelEach#grep since it isn't used anywhere.
|
567
848
|
* Renamed Runnable#__name__ to Runnable#name (but uses @NAME internally).
|
data/Manifest.txt
CHANGED
@@ -9,14 +9,18 @@ lib/minitest.rb
|
|
9
9
|
lib/minitest/assertions.rb
|
10
10
|
lib/minitest/autorun.rb
|
11
11
|
lib/minitest/benchmark.rb
|
12
|
+
lib/minitest/compress.rb
|
13
|
+
lib/minitest/error_on_warning.rb
|
12
14
|
lib/minitest/expectations.rb
|
13
15
|
lib/minitest/hell.rb
|
16
|
+
lib/minitest/manual_plugins.rb
|
14
17
|
lib/minitest/mock.rb
|
15
18
|
lib/minitest/parallel.rb
|
16
19
|
lib/minitest/pride.rb
|
17
20
|
lib/minitest/pride_plugin.rb
|
18
21
|
lib/minitest/spec.rb
|
19
22
|
lib/minitest/test.rb
|
23
|
+
lib/minitest/test_task.rb
|
20
24
|
lib/minitest/unit.rb
|
21
25
|
test/minitest/metametameta.rb
|
22
26
|
test/minitest/test_minitest_assertions.rb
|
@@ -25,3 +29,4 @@ test/minitest/test_minitest_mock.rb
|
|
25
29
|
test/minitest/test_minitest_reporter.rb
|
26
30
|
test/minitest/test_minitest_spec.rb
|
27
31
|
test/minitest/test_minitest_test.rb
|
32
|
+
test/minitest/test_minitest_test_task.rb
|
data/README.rdoc
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
= minitest/{test,spec,mock,benchmark}
|
2
2
|
|
3
|
-
home :: https://github.com/
|
4
|
-
bugs :: https://github.com/
|
5
|
-
rdoc ::
|
3
|
+
home :: https://github.com/minitest/minitest
|
4
|
+
bugs :: https://github.com/minitest/minitest/issues
|
5
|
+
rdoc :: https://docs.seattlerb.org/minitest
|
6
|
+
clog :: https://github.com/minitest/minitest/blob/master/History.rdoc
|
6
7
|
vim :: https://github.com/sunaku/vim-ruby-minitest
|
7
8
|
emacs:: https://github.com/arthurnn/minitest-emacs
|
8
9
|
|
@@ -70,6 +71,7 @@ extract-method refactorings still apply.
|
|
70
71
|
* minitest/mock - a simple and clean mock/stub system.
|
71
72
|
* minitest/benchmark - an awesome way to assert your algorithm's performance.
|
72
73
|
* minitest/pride - show your pride in testing!
|
74
|
+
* minitest/test_task - a full-featured and clean rake task generator.
|
73
75
|
* Incredibly small and fast runner, but no bells and whistles.
|
74
76
|
* Written by squishy human beings. Software can never be perfect. We will all eventually die.
|
75
77
|
|
@@ -186,7 +188,7 @@ Output is tab-delimited to make it easy to paste into a spreadsheet.
|
|
186
188
|
=== Mocks
|
187
189
|
|
188
190
|
Mocks and stubs defined using terminology by Fowler & Meszaros at
|
189
|
-
|
191
|
+
https://www.martinfowler.com/bliki/TestDouble.html:
|
190
192
|
|
191
193
|
"Mocks are pre-programmed with expectations which form a specification
|
192
194
|
of the calls they are expected to receive. They can throw an exception
|
@@ -237,7 +239,7 @@ an example of asserting that code inside a thread is run:
|
|
237
239
|
=== Stubs
|
238
240
|
|
239
241
|
Mocks and stubs are defined using terminology by Fowler & Meszaros at
|
240
|
-
|
242
|
+
https://www.martinfowler.com/bliki/TestDouble.html:
|
241
243
|
|
242
244
|
"Stubs provide canned answers to calls made during the test".
|
243
245
|
|
@@ -264,9 +266,8 @@ new non-existing method:
|
|
264
266
|
|
265
267
|
=== Running Your Tests
|
266
268
|
|
267
|
-
Ideally, you'll use a rake task to run your tests, either
|
268
|
-
all at once.
|
269
|
-
tests. BUT! You don't have to:
|
269
|
+
Ideally, you'll use a rake task to run your tests (see below), either
|
270
|
+
piecemeal or all at once. BUT! You don't have to:
|
270
271
|
|
271
272
|
% ruby -Ilib:test test/minitest/test_minitest_test.rb
|
272
273
|
Run options: --seed 37685
|
@@ -294,18 +295,45 @@ provided via plugins. To see them, simply run with +--help+:
|
|
294
295
|
-p, --pride Pride. Show your testing pride!
|
295
296
|
-a, --autotest Connect to autotest server.
|
296
297
|
|
298
|
+
=== Rake Tasks
|
299
|
+
|
297
300
|
You can set up a rake task to run all your tests by adding this to your Rakefile:
|
298
301
|
|
299
|
-
require "
|
302
|
+
require "minitest/test_task"
|
303
|
+
|
304
|
+
Minitest::TestTask.create # named test, sensible defaults
|
300
305
|
|
301
|
-
|
306
|
+
# or more explicitly:
|
307
|
+
|
308
|
+
Minitest::TestTask.create(:test) do |t|
|
302
309
|
t.libs << "test"
|
303
310
|
t.libs << "lib"
|
304
|
-
t.
|
311
|
+
t.warning = false
|
312
|
+
t.test_globs = ["test/**/*_test.rb"]
|
305
313
|
end
|
306
314
|
|
307
315
|
task :default => :test
|
308
316
|
|
317
|
+
Each of these will generate 4 tasks:
|
318
|
+
|
319
|
+
rake test :: Run the test suite.
|
320
|
+
rake test:cmd :: Print out the test command.
|
321
|
+
rake test:isolated :: Show which test files fail when run separately.
|
322
|
+
rake test:slow :: Show bottom 25 tests sorted by time.
|
323
|
+
|
324
|
+
=== Rake Task Variables
|
325
|
+
|
326
|
+
There are a bunch of variables you can supply to rake to modify the run.
|
327
|
+
|
328
|
+
MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs.
|
329
|
+
N :: -n: Tests to run (string or /regexp/).
|
330
|
+
X :: -x: Tests to exclude (string or /regexp/).
|
331
|
+
A :: Any extra arguments. Honors shell quoting.
|
332
|
+
MT_CPU :: How many threads to use for parallel test runs
|
333
|
+
SEED :: -s --seed Sets random seed.
|
334
|
+
TESTOPTS :: Deprecated, same as A
|
335
|
+
FILTER :: Deprecated, same as A
|
336
|
+
|
309
337
|
== Writing Extensions
|
310
338
|
|
311
339
|
To define a plugin, add a file named minitest/XXX_plugin.rb to your
|
@@ -378,39 +406,46 @@ Using our example above, here is how we might implement MyCI:
|
|
378
406
|
|
379
407
|
=== What versions are compatible with what? Or what versions are supported?
|
380
408
|
|
381
|
-
Minitest is a dependency of rails, which until
|
409
|
+
Minitest is a dependency of rails, which until very recently had an
|
382
410
|
overzealous backwards compatibility policy. As such, I'm stuck
|
383
|
-
supporting versions of ruby that are long past EOL.
|
384
|
-
|
385
|
-
|
411
|
+
supporting versions of ruby that are long past EOL. Hopefully I'll be
|
412
|
+
able to support only current versions of ruby sometime in the near
|
413
|
+
future.
|
414
|
+
|
415
|
+
NOTICE: At this point, I will only locally test/dev against the
|
416
|
+
currently 3 supported (non-EOL) versions of ruby. I cannot and will
|
417
|
+
not maintain that many builds.
|
386
418
|
|
387
|
-
(As of
|
419
|
+
(As of 2025-02-03)
|
388
420
|
|
389
421
|
Current versions of rails: (https://endoflife.date/rails)
|
390
422
|
|
391
|
-
| rails | min ruby |
|
392
|
-
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
423
|
+
| rails | min ruby | minitest | status | EOL Date |
|
424
|
+
|-------+----------+----------+----------+------------|
|
425
|
+
| 8.0 | >= 3.2 | >= 5.1 | Current | 2026-11-07 |
|
426
|
+
| 7.2 | >= 3.1 | >= 5.1 | Current | 2026-08-09 |
|
427
|
+
| 7.1 | >= 2.7 | >= 5.1 | Security | 2025-10-01 |
|
428
|
+
| 7.0 | >= 2.7 | >= 5.1 | Security | 2025-04-01 |
|
429
|
+
| 6.1 | >= 2.5 | >= 5.1 | EOL | 2024-10-01 |
|
430
|
+
| 6.0 | >= 2.5 | >= 5.1 | EOL | 2023-06-01 |
|
431
|
+
| 5.2 | >= 2.2.2 | ~> 5.1 | EOL | 2022-06-01 |
|
432
|
+
|
433
|
+
If you want to look at the requirements for a specific version, run:
|
434
|
+
|
435
|
+
gem spec -r --ruby rails -v 8.0.0
|
397
436
|
|
398
437
|
Current versions of ruby: (https://endoflife.date/ruby)
|
399
438
|
|
400
439
|
| ruby | Status | EOL Date |
|
401
440
|
|------+---------+------------|
|
402
|
-
| 3.
|
403
|
-
|
|
404
|
-
| 2
|
405
|
-
|
|
406
|
-
|
|
407
|
-
| 2.
|
408
|
-
| 2.
|
409
|
-
|
410
|
-
See also:
|
411
|
-
|
412
|
-
* https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
|
413
|
-
* https://jamesjeffersconsulting.com/ruby-rails-version-matrix/
|
441
|
+
| 3.4 | Current | 2028-03-31 |
|
442
|
+
| 3.3 | Maint | 2027-03-31 |
|
443
|
+
| 3.2 | Security| 2026-03-31 |
|
444
|
+
| 3.1 | EOL | 2025-03-31 |
|
445
|
+
| 3.0 | EOL | 2024-03-31 |
|
446
|
+
| 2.7 | EOL | 2023-03-31 |
|
447
|
+
| 2.6 | EOL | 2022-03-31 |
|
448
|
+
| 2.5 | EOL | 2021-03-31 |
|
414
449
|
|
415
450
|
=== How to test SimpleDelegates?
|
416
451
|
|
@@ -614,6 +649,7 @@ minitest-capistrano :: Assertions and expectations for testing
|
|
614
649
|
Capistrano recipes.
|
615
650
|
minitest-capybara :: Capybara matchers support for minitest unit and
|
616
651
|
spec.
|
652
|
+
minitest-cc :: It provides minimal information about code coverage.
|
617
653
|
minitest-chef-handler :: Run Minitest suites as Chef report handlers
|
618
654
|
minitest-ci :: CI reporter plugin for Minitest.
|
619
655
|
minitest-context :: Defines contexts for code reuse in Minitest
|
@@ -647,6 +683,7 @@ minitest-growl :: Test notifier for minitest via growl.
|
|
647
683
|
minitest-happy :: GLOBALLY ACTIVATE MINITEST PRIDE! RAWR!
|
648
684
|
minitest-have_tag :: Adds Minitest assertions to test for the existence of
|
649
685
|
HTML tags, including contents, within a provided string.
|
686
|
+
minitest-heat :: Reporting that builds a heat map of failure locations
|
650
687
|
minitest-hooks :: Around and before_all/after_all/around_all hooks
|
651
688
|
minitest-hyper :: Pretty, single-page HTML reports for your Minitest runs
|
652
689
|
minitest-implicit-subject :: Implicit declaration of the test subject.
|
@@ -711,7 +748,7 @@ minitest-stub-const :: Stub constants for the duration of a block.
|
|
711
748
|
minitest-tags :: Add tags for minitest.
|
712
749
|
minitest-unordered :: Adds a new assertion to minitest for checking the
|
713
750
|
contents of a collection, ignoring element order.
|
714
|
-
minitest-vcr :: Automatic cassette
|
751
|
+
minitest-vcr :: Automatic cassette management with Minitest::Spec
|
715
752
|
and VCR.
|
716
753
|
minitest_log :: Adds structured logging, data explication, and verdicts.
|
717
754
|
minitest_owrapper :: Get tests results as a TestResult object.
|
@@ -721,8 +758,13 @@ mongoid-minitest :: Minitest matchers for Mongoid.
|
|
721
758
|
mutant-minitest :: Minitest integration for mutant.
|
722
759
|
pry-rescue :: A pry plugin w/ minitest support. See
|
723
760
|
pry-rescue/minitest.rb.
|
761
|
+
rematch :: Declutter your test files from large hardcoded data
|
762
|
+
and update them automatically when your code changes.
|
724
763
|
rspec2minitest :: Easily translate any RSpec matchers to Minitest
|
725
764
|
assertions and expectations.
|
765
|
+
stubberry :: Multiple stubbing 'berries', sweet and useful
|
766
|
+
stub helpers and assertions. ( stub_must,
|
767
|
+
assert_method_called, stubbing ORM objects by id )
|
726
768
|
|
727
769
|
== Unknown Extensions:
|
728
770
|
|
@@ -748,7 +790,7 @@ Authors... Please send me a pull request with a description of your minitest ext
|
|
748
790
|
|
749
791
|
== Minitest related goods
|
750
792
|
|
751
|
-
* minitest/pride fabric:
|
793
|
+
* minitest/pride fabric: https://www.spoonflower.com/fabric/3928730-again-by-katie_allen
|
752
794
|
|
753
795
|
== REQUIREMENTS:
|
754
796
|
|
data/Rakefile
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "rubygems"
|
4
4
|
require "hoe"
|
5
|
+
$:.unshift "lib" # to pick up lib/minitest/test_task.rb when minitest not installed
|
5
6
|
|
6
7
|
Hoe.plugin :seattlerb
|
7
8
|
Hoe.plugin :rdoc
|
@@ -11,7 +12,7 @@ Hoe.spec "minitest" do
|
|
11
12
|
|
12
13
|
license "MIT"
|
13
14
|
|
14
|
-
require_ruby_version [">= 2.
|
15
|
+
require_ruby_version [">= 2.7", "< 4.0"]
|
15
16
|
end
|
16
17
|
|
17
18
|
desc "Find missing expectations"
|
@@ -32,6 +33,7 @@ task :specs do
|
|
32
33
|
/_includes/ => "_include",
|
33
34
|
/(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
|
34
35
|
/must_raises/ => "must_raise",
|
36
|
+
/(must|wont)_pattern/ => '\1_pattern_match',
|
35
37
|
/(must|wont)_predicate/ => '\1_be',
|
36
38
|
/(must|wont)_path_exists/ => 'path_\1_exist',
|
37
39
|
}
|
@@ -71,4 +73,9 @@ task :bugs do
|
|
71
73
|
sh "for f in bug*.rb ; do echo $f; echo; #{Gem.ruby} -Ilib $f && rm $f ; done"
|
72
74
|
end
|
73
75
|
|
76
|
+
Minitest::TestTask.create :testW0 do |t|
|
77
|
+
t.warning = false
|
78
|
+
t.test_prelude = "$-w = nil"
|
79
|
+
end
|
80
|
+
|
74
81
|
# vim: syntax=Ruby
|
data/lib/hoe/minitest.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# :stopdoc:
|
2
2
|
|
3
3
|
class Hoe
|
4
|
+
# empty
|
4
5
|
end
|
5
6
|
|
6
7
|
module Hoe::Minitest
|
@@ -16,7 +17,7 @@ module Hoe::Minitest
|
|
16
17
|
|
17
18
|
gem "minitest"
|
18
19
|
require "minitest"
|
19
|
-
version = Minitest::VERSION.split(
|
20
|
+
version = Minitest::VERSION.split(".").first(2).join "."
|
20
21
|
|
21
22
|
dependency "minitest", "~> #{version}", :development unless
|
22
23
|
minitest? or ENV["MT_NO_ISOLATE"]
|
@@ -24,9 +25,5 @@ module Hoe::Minitest
|
|
24
25
|
|
25
26
|
def define_minitest_tasks
|
26
27
|
self.testlib = :minitest
|
27
|
-
|
28
|
-
# make sure we use the gemmed minitest on 1.9
|
29
|
-
self.test_prelude = 'gem "minitest"' unless
|
30
|
-
minitest? or ENV["MT_NO_ISOLATE"]
|
31
28
|
end
|
32
29
|
end
|