minitest 5.20.0 → 5.27.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 +4 -4
- checksums.yaml.gz.sig +4 -4
- data/History.rdoc +206 -3
- data/Manifest.txt +3 -0
- data/README.rdoc +30 -17
- data/Rakefile +24 -2
- data/design_rationale.rb +21 -19
- data/lib/hoe/minitest.rb +4 -2
- data/lib/minitest/assertions.rb +92 -100
- data/lib/minitest/autorun.rb +4 -11
- data/lib/minitest/benchmark.rb +8 -11
- data/lib/minitest/compress.rb +94 -0
- data/lib/minitest/error_on_warning.rb +11 -0
- data/lib/minitest/expectations.rb +2 -2
- data/lib/minitest/hell.rb +1 -1
- data/lib/minitest/manual_plugins.rb +16 -0
- data/lib/minitest/mock.rb +44 -44
- data/lib/minitest/parallel.rb +7 -5
- data/lib/minitest/pride.rb +1 -1
- data/lib/minitest/pride_plugin.rb +17 -24
- data/lib/minitest/spec.rb +22 -18
- data/lib/minitest/test.rb +19 -29
- data/lib/minitest/test_task.rb +45 -23
- data/lib/minitest/unit.rb +1 -1
- data/lib/minitest.rb +289 -160
- data/test/minitest/metametameta.rb +32 -18
- data/test/minitest/test_minitest_assertions.rb +173 -197
- data/test/minitest/test_minitest_benchmark.rb +1 -1
- data/test/minitest/test_minitest_mock.rb +156 -89
- data/test/minitest/test_minitest_reporter.rb +120 -24
- data/test/minitest/test_minitest_spec.rb +95 -82
- data/test/minitest/test_minitest_test.rb +212 -120
- data/test/minitest/test_minitest_test_task.rb +18 -7
- data.tar.gz.sig +0 -0
- metadata +36 -22
- 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: f9144898bc998f49d23688386cb435165b7ba6fadf83acc47f8120992d2799c6
|
|
4
|
+
data.tar.gz: f90178ecc10c76e8d0cea4c2206972b3bbb899f552c53f1b22743e00d9898a02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a157620a20602d17c8aaf088cc9c709401d7fd3507569fceb85d358c5519596fdb2bd71ef8b1b597942ba9ba5ef9b0af1530fb97a47fac28add36600516d2edc
|
|
7
|
+
data.tar.gz: 17c0fdb228c63bda818fbc4009c30c88138df74e325e087050843bef8128ea54afade9de4c0e5af6d5f734ad114d34dd97e4eed2ac4e577662144ad8c49f261e
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
��ި�f5e4|���8%8V�:��]X�o���q
|
|
3
|
+
��uץ6 ��#�()��u��N������<�ƅ�v
|
|
4
|
+
�������75��NY���x�z@�~�9�� {��e�\���E�N��jp�4�2ovX�l1��f�k�����Ru��qvO�d��%���������87y�5�4r����
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,206 @@
|
|
|
1
|
+
=== 5.26.2 / 2025-11-17
|
|
2
|
+
|
|
3
|
+
* 5 bug fixes:
|
|
4
|
+
|
|
5
|
+
* Bumped minimum ruby to 3.1.
|
|
6
|
+
* Alias Spec#name to #inspect for cleaner output in repls.
|
|
7
|
+
* Fix pathing for Hoe::Minitest initialization to be more generic.
|
|
8
|
+
* Fixed refute_in_epsilon to use min of abs values. (wtn)
|
|
9
|
+
* Improved options processing and usage output to be more clear.
|
|
10
|
+
|
|
11
|
+
=== 5.26.1 / 2025-11-08
|
|
12
|
+
|
|
13
|
+
The Ocean Shores, Slightly Less Tipsy Edition!
|
|
14
|
+
|
|
15
|
+
* 3 bug fixes:
|
|
16
|
+
|
|
17
|
+
* Add links to API doco in README.
|
|
18
|
+
* Add missing require thread.
|
|
19
|
+
* Bumped ruby version to include 4.0 (trunk). (hsbt)
|
|
20
|
+
(see also 5.14.2)
|
|
21
|
+
|
|
22
|
+
=== 5.26.0 / 2025-10-07
|
|
23
|
+
|
|
24
|
+
The Seattle.rb Nerd Party, Slightly Tipsy Edition!
|
|
25
|
+
|
|
26
|
+
* 2 minor enhancements:
|
|
27
|
+
|
|
28
|
+
* Added extra documentation to Minitest::TestTask options.
|
|
29
|
+
* Make parallelize_me! a no-op when n_threads=1.
|
|
30
|
+
|
|
31
|
+
* 9 bug fixes:
|
|
32
|
+
|
|
33
|
+
* Bypass parallel_executor entirely when n_threads=1.
|
|
34
|
+
* Don't require rubygems in Rakefile... it is 2025.
|
|
35
|
+
* Ensure that minitest exits non-zero on Interrupt. (tavianator)
|
|
36
|
+
* Fix Minitest.run sequence rdoc to include loop vars and read consistently.
|
|
37
|
+
* Fix call to parallel_executor.shutdown when it isn't defined.
|
|
38
|
+
* Removed some 1.8/1.9-based code from the assertions and expectations.
|
|
39
|
+
* Still fighting with rdoc? Yup. Still fighting with rdoc...
|
|
40
|
+
* Switched assert_equal's diff from Tempfile.open to Tempfile.create.
|
|
41
|
+
* Use Regexp.escape for BASE_RE in case pwd has special chars. (astra_1993)
|
|
42
|
+
|
|
43
|
+
=== 5.25.5 / 2025-03-12
|
|
44
|
+
|
|
45
|
+
* 4 bug fixes:
|
|
46
|
+
|
|
47
|
+
* Bumped minimum ruby to 2.7.
|
|
48
|
+
* Fixed expectation docs for must/wont_pattern_match. (jaredcwhite)
|
|
49
|
+
* Reorder Minitest::Test.ancestors to allow reaching Minitest::Assertions#skipped? (Edouard-chin)
|
|
50
|
+
* Update the ruby and rails compatibility tables. (bquorning)
|
|
51
|
+
|
|
52
|
+
=== 5.25.4 / 2024-12-03
|
|
53
|
+
|
|
54
|
+
* 1 bug fix:
|
|
55
|
+
|
|
56
|
+
* Fix for must_verify definition if only requiring minitest/mock (but why?).
|
|
57
|
+
|
|
58
|
+
=== 5.25.3 / 2024-12-03
|
|
59
|
+
|
|
60
|
+
* 5 bug fixes:
|
|
61
|
+
|
|
62
|
+
* Fixed assert_mock to fail instead of raise on unmet mock expectations.
|
|
63
|
+
* Fixed assert_mock to take an optional message argument.
|
|
64
|
+
* Fixed formatting of unmet mock expectation messages.
|
|
65
|
+
* Fixed missing must_verify expectation to match assert_mock.
|
|
66
|
+
* minitest/pride: Fixed to use true colors with *-direct terminals (bk2204)
|
|
67
|
+
|
|
68
|
+
=== 5.25.2 / 2024-11-21
|
|
69
|
+
|
|
70
|
+
* 4 bug fixes:
|
|
71
|
+
|
|
72
|
+
* Include class name in spec name. (thomasmarshall)
|
|
73
|
+
* Fixed 'redefining object_id' warning from ruby 3.4. (mattbrictson)
|
|
74
|
+
* Minitest top-level namespace no longer includes entire contents of README.rdoc. Too much!
|
|
75
|
+
* Refactored spec's describe to more cleanly determine the superclass and name
|
|
76
|
+
|
|
77
|
+
=== 5.25.1 / 2024-08-16
|
|
78
|
+
|
|
79
|
+
* 2 bug fixes:
|
|
80
|
+
|
|
81
|
+
* Fix incompatibility caused by minitest-hooks & rails invading minitest internals.
|
|
82
|
+
* Revert change from =~ to match? to allow for nil if $TERM undefined.
|
|
83
|
+
|
|
84
|
+
=== 5.25.0 / 2024-08-13
|
|
85
|
+
|
|
86
|
+
* 2 minor enhancements:
|
|
87
|
+
|
|
88
|
+
* Fixed some inefficiencies filtering and matching (mostly backtraces).
|
|
89
|
+
* Refactored siginfo handler to reduce runtime costs. Saved ~30%!
|
|
90
|
+
|
|
91
|
+
* 5 bug fixes:
|
|
92
|
+
|
|
93
|
+
* Added missing rdoc to get back to 100% coverage.
|
|
94
|
+
* Cleaning up ancient code checking for defined?(Encoding) and the like.
|
|
95
|
+
* Disambiguated some shadowed variables in minitest/compress.
|
|
96
|
+
* Fixed an ironic bug if using string-literals AND Werror.
|
|
97
|
+
* Improve description of test:slow task. (stomar)
|
|
98
|
+
|
|
99
|
+
=== 5.24.1 / 2024-06-29
|
|
100
|
+
|
|
101
|
+
* 1 bug fix:
|
|
102
|
+
|
|
103
|
+
* Fix the error message when an extension is invalid value. (y-yagi)
|
|
104
|
+
|
|
105
|
+
=== 5.24.0 / 2024-06-18
|
|
106
|
+
|
|
107
|
+
* 2 minor enhancements:
|
|
108
|
+
|
|
109
|
+
* Added Minitest.register_plugin.
|
|
110
|
+
* Extended plugin system to work with modules/classes for opt-out plugins.
|
|
111
|
+
|
|
112
|
+
* 1 bug fix:
|
|
113
|
+
|
|
114
|
+
* Removed anacronism, but allow load_plugins to exit gracefully if --disable=gems.
|
|
115
|
+
|
|
116
|
+
=== 5.23.1 / 2024-05-21
|
|
117
|
+
|
|
118
|
+
* 1 bug fix:
|
|
119
|
+
|
|
120
|
+
* Fully qualify the Queue class to avoid conflicts with other libraries. (rafaelfranca)
|
|
121
|
+
|
|
122
|
+
=== 5.23.0 / 2024-05-15
|
|
123
|
+
|
|
124
|
+
* 3 minor enhancements:
|
|
125
|
+
|
|
126
|
+
* Added -Werror to raise on any warning output. (byroot)
|
|
127
|
+
* Added UnexpectedWarning as a failure summary type, added count to output if activated.
|
|
128
|
+
* Added minitest/manual_plugins.rb w/ new Minitest.load method. (tenderlove)
|
|
129
|
+
|
|
130
|
+
* 2 bug fixes:
|
|
131
|
+
|
|
132
|
+
* Allow empty_run! and reporter to display summary for empty runs. (zzak)
|
|
133
|
+
* Make test task verbose using either rake's -v or -t (was just -t).
|
|
134
|
+
|
|
135
|
+
=== 5.22.3 / 2024-03-13
|
|
136
|
+
|
|
137
|
+
* 1 minor enhancement:
|
|
138
|
+
|
|
139
|
+
* MASSIVE improvement of minitest's pride plugin output: Frequencies doubled! Sine waves shifted!! Comments improved!!! Colors rotated!!!! (havenwood)
|
|
140
|
+
|
|
141
|
+
* 3 bug fixes:
|
|
142
|
+
|
|
143
|
+
* Improved wording on Minitest::Test#parallelize_me! to clarify it goes INSIDE your test class/describe.
|
|
144
|
+
* Minor changes to tests to pass when tests ran with extra flags (eg -p).
|
|
145
|
+
* Support Ruby 3.4's new error message format. (mame)
|
|
146
|
+
|
|
147
|
+
=== 5.22.2 / 2024-02-07
|
|
148
|
+
|
|
149
|
+
* 1 bug fix:
|
|
150
|
+
|
|
151
|
+
* Third time's a charm? Remember: 'ensure' is almost always the
|
|
152
|
+
wrong way to go (for results... it's great for cleaning up).
|
|
153
|
+
|
|
154
|
+
=== 5.22.1 / 2024-02-06
|
|
155
|
+
|
|
156
|
+
* 1 bug fix:
|
|
157
|
+
|
|
158
|
+
* Don't exit non-zero if no tests ran and no filter (aka, the test file is empty).
|
|
159
|
+
(I'm starting to think the exit 1 thing for @tenderlove was a mistake...)
|
|
160
|
+
|
|
161
|
+
=== 5.22.0 / 2024-02-05
|
|
162
|
+
|
|
163
|
+
* 1 minor enhancement:
|
|
164
|
+
|
|
165
|
+
* Added "did you mean" output if your --name filter matches nothing. (tenderlove)
|
|
166
|
+
|
|
167
|
+
* 2 bug fixes:
|
|
168
|
+
|
|
169
|
+
* Big cleanup of test filtering. Much prettier / more functional.
|
|
170
|
+
* Fix situation where Assertion#location can't find the location. (pftg)
|
|
171
|
+
|
|
172
|
+
=== 5.21.2 / 2024-01-17
|
|
173
|
+
|
|
174
|
+
* 1 bug fix:
|
|
175
|
+
|
|
176
|
+
* Fixed bug in Minitest::Compress#compress formatting w/ nested patterns. Now recurses properly.
|
|
177
|
+
|
|
178
|
+
=== 5.21.1 / 2024-01-11
|
|
179
|
+
|
|
180
|
+
* 1 bug fix:
|
|
181
|
+
|
|
182
|
+
* Rails' default backtrace filter can't currently work with caller_locations, so reverting back to caller.
|
|
183
|
+
|
|
184
|
+
=== 5.21.0 / 2024-01-11
|
|
185
|
+
|
|
186
|
+
* 10 minor enhancements:
|
|
187
|
+
|
|
188
|
+
* Add include_all kw arg to assert_respond_to and refute_respond_to.
|
|
189
|
+
* Added --quiet flag to skip ProgressReporter (prints the dots). Minor speedup.
|
|
190
|
+
* Added Minitest::Compress#compress and added it to UnexpectedError.
|
|
191
|
+
* Added ability to initialize BacktraceFilter w/ custom regexp.
|
|
192
|
+
* Filter failure backtraces using backtrace_filter before calculating location. (thomasmarshall)
|
|
193
|
+
* Make BacktraceFilter#filter compatible with locations (still compares strings).
|
|
194
|
+
* Optimized Assertion#location ~30%.
|
|
195
|
+
* Output relative paths for all failures/errors/backtraces.
|
|
196
|
+
* Refactored location information in assertions, now using locations.
|
|
197
|
+
* Removed thread and mutex_m dependencies. (hsbt, eregon)
|
|
198
|
+
|
|
199
|
+
* 2 bug fixes:
|
|
200
|
+
|
|
201
|
+
* Drop undocumented bt arg in #skip. Dunno why that ever happened, prolly for testing?
|
|
202
|
+
* Fix mock to work with ruby debugger enabled. (keithlayne)
|
|
203
|
+
|
|
1
204
|
=== 5.20.0 / 2023-09-06
|
|
2
205
|
|
|
3
206
|
* 1 minor enhancement:
|
|
@@ -9,7 +212,7 @@
|
|
|
9
212
|
* 2 minor enhancements:
|
|
10
213
|
|
|
11
214
|
* Add metadata lazy accessor to Runnable / Result. (matteeyah)
|
|
12
|
-
* Only load minitest/unit (aka ancient MiniTest compatibility layer) if ENV["MT_COMPAT"]
|
|
215
|
+
* Only load minitest/unit (aka ancient MiniTest compatibility layer) if \ENV[\"MT_COMPAT\"]
|
|
13
216
|
|
|
14
217
|
* 1 bug fix:
|
|
15
218
|
|
|
@@ -20,7 +223,7 @@
|
|
|
20
223
|
* 3 bug fixes:
|
|
21
224
|
|
|
22
225
|
* Avoid extra string allocations when filtering tests. (tenderlove)
|
|
23
|
-
* Only mention deprecated ENV['N'] if it is an integer string.
|
|
226
|
+
* Only mention deprecated \ENV[\'N\'] if it is an integer string.
|
|
24
227
|
* Push up test_order to Minitest::Runnable to fix minitest/hell. (koic)
|
|
25
228
|
|
|
26
229
|
=== 5.18.0 / 2023-03-04
|
|
@@ -214,7 +417,7 @@
|
|
|
214
417
|
|
|
215
418
|
* 3 bug fixes:
|
|
216
419
|
|
|
217
|
-
* Check
|
|
420
|
+
* Check \option[:filter] klass before match. Fixes 2.6 warning. (y-yagi)
|
|
218
421
|
* Fixed Assertions#diff from recalculating if set to nil
|
|
219
422
|
* Fixed spec section of readme to not use deprecated global expectations. (CheezItMan)
|
|
220
423
|
|
data/Manifest.txt
CHANGED
|
@@ -9,8 +9,11 @@ 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
|
data/README.rdoc
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
= minitest/{test,spec,mock,benchmark}
|
|
2
2
|
|
|
3
|
-
home :: https://
|
|
3
|
+
home :: https://minite.st/
|
|
4
|
+
code :: https://github.com/minitest/minitest
|
|
4
5
|
bugs :: https://github.com/minitest/minitest/issues
|
|
5
6
|
rdoc :: https://docs.seattlerb.org/minitest
|
|
6
|
-
|
|
7
|
+
clog :: https://github.com/minitest/minitest/blob/master/History.rdoc
|
|
7
8
|
emacs:: https://github.com/arthurnn/minitest-emacs
|
|
9
|
+
vim :: https://github.com/vim-test/vim-test
|
|
8
10
|
|
|
9
11
|
== DESCRIPTION:
|
|
10
12
|
|
|
@@ -94,7 +96,9 @@ Given that you'd like to test the following class:
|
|
|
94
96
|
|
|
95
97
|
=== Unit tests
|
|
96
98
|
|
|
97
|
-
Define your tests as methods beginning with +test_+.
|
|
99
|
+
Define your tests as methods beginning with +test_+. Use
|
|
100
|
+
{assertions}[/minitest/Minitest/Assertions.html] to test for results
|
|
101
|
+
or state.
|
|
98
102
|
|
|
99
103
|
require "minitest/autorun"
|
|
100
104
|
|
|
@@ -118,6 +122,9 @@ Define your tests as methods beginning with +test_+.
|
|
|
118
122
|
|
|
119
123
|
=== Specs
|
|
120
124
|
|
|
125
|
+
Use {expectations}[/minitest/Minitest/Expectations.html] to check
|
|
126
|
+
results or state. They must be wrapped in a value call (eg +_+).
|
|
127
|
+
|
|
121
128
|
require "minitest/autorun"
|
|
122
129
|
|
|
123
130
|
describe Meme do
|
|
@@ -145,7 +152,7 @@ For matchers support check out:
|
|
|
145
152
|
|
|
146
153
|
=== Benchmarks
|
|
147
154
|
|
|
148
|
-
Add benchmarks to your tests.
|
|
155
|
+
Add {benchmarks}[/minitest/Minitest/Benchmark.html] to your tests.
|
|
149
156
|
|
|
150
157
|
# optionally run benchmarks, good for CI-only work!
|
|
151
158
|
require "minitest/benchmark" if ENV["BENCH"]
|
|
@@ -405,35 +412,41 @@ Using our example above, here is how we might implement MyCI:
|
|
|
405
412
|
|
|
406
413
|
=== What versions are compatible with what? Or what versions are supported?
|
|
407
414
|
|
|
408
|
-
Minitest is a dependency of rails, which until
|
|
415
|
+
Minitest is a dependency of rails, which until very recently had an
|
|
409
416
|
overzealous backwards compatibility policy. As such, I'm stuck
|
|
410
417
|
supporting versions of ruby that are long past EOL. Hopefully I'll be
|
|
411
418
|
able to support only current versions of ruby sometime in the near
|
|
412
419
|
future.
|
|
413
420
|
|
|
414
|
-
|
|
421
|
+
NOTICE: At this point, I will only locally test/dev against the
|
|
422
|
+
currently 3 supported (non-EOL) versions of ruby. I cannot and will
|
|
423
|
+
not maintain that many builds.
|
|
424
|
+
|
|
425
|
+
(As of 2025-02-03)
|
|
415
426
|
|
|
416
427
|
Current versions of rails: (https://endoflife.date/rails)
|
|
417
428
|
|
|
418
|
-
| rails | min ruby |
|
|
419
|
-
|
|
420
|
-
|
|
|
421
|
-
|
|
|
422
|
-
|
|
|
423
|
-
|
|
|
429
|
+
| rails | min ruby | minitest | status | EOL Date |
|
|
430
|
+
|-------+----------+----------+----------+------------|
|
|
431
|
+
| 8.1 | >= 3.2 | >= 5.1 | Current | 2027-10-07 |
|
|
432
|
+
| 8.0 | >= 3.2 | >= 5.1 | Current | 2026-11-07 |
|
|
433
|
+
| 7.2 | >= 3.1 | >= 5.1 | Security | 2026-08-09 |
|
|
434
|
+
| 7.1 | >= 2.7 | >= 5.1 | EOL | 2025-10-01 |
|
|
424
435
|
|
|
425
436
|
If you want to look at the requirements for a specific version, run:
|
|
426
437
|
|
|
427
|
-
gem spec -r --ruby rails -v
|
|
438
|
+
gem spec -r --ruby rails -v 8.0.0
|
|
428
439
|
|
|
429
440
|
Current versions of ruby: (https://endoflife.date/ruby)
|
|
430
441
|
|
|
431
442
|
| ruby | Status | EOL Date |
|
|
432
443
|
|------+---------+------------|
|
|
433
|
-
| 3.
|
|
434
|
-
| 3.
|
|
435
|
-
| 3.
|
|
436
|
-
|
|
|
444
|
+
| 3.4 | Current | 2028-03-31 |
|
|
445
|
+
| 3.3 | Maint | 2027-03-31 |
|
|
446
|
+
| 3.2 | Security| 2026-03-31 |
|
|
447
|
+
| 3.1 | EOL | 2025-03-31 |
|
|
448
|
+
| 3.0 | EOL | 2024-03-31 |
|
|
449
|
+
| 2.7 | EOL | 2023-03-31 |
|
|
437
450
|
| 2.6 | EOL | 2022-03-31 |
|
|
438
451
|
| 2.5 | EOL | 2021-03-31 |
|
|
439
452
|
|
data/Rakefile
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# -*- ruby -*-
|
|
2
2
|
|
|
3
|
-
require "rubygems"
|
|
4
3
|
require "hoe"
|
|
5
4
|
$:.unshift "lib" # to pick up lib/minitest/test_task.rb when minitest not installed
|
|
6
5
|
|
|
@@ -12,7 +11,24 @@ Hoe.spec "minitest" do
|
|
|
12
11
|
|
|
13
12
|
license "MIT"
|
|
14
13
|
|
|
15
|
-
require_ruby_version
|
|
14
|
+
require_ruby_version ">= 3.1"
|
|
15
|
+
|
|
16
|
+
self.post_install_message = <<~EOM
|
|
17
|
+
NOTE: minitest 5 will be the last in the minitest family to support
|
|
18
|
+
ruby 1.8 to 2.7. If you need to keep using these versions,
|
|
19
|
+
you need to pin your dependency to minitest with something
|
|
20
|
+
like "~> 5.0". See History.rdoc to locate compatible
|
|
21
|
+
versions.
|
|
22
|
+
|
|
23
|
+
Further, minitest 6 will be dropping the following:
|
|
24
|
+
|
|
25
|
+
+ MiniTest (it's been Minitest for >10 years)
|
|
26
|
+
+ MiniTest::Unit
|
|
27
|
+
+ MiniTest::Unit::TestCase
|
|
28
|
+
+ assert_send (unless you argue for it well)
|
|
29
|
+
+ assert_equal nil, obj
|
|
30
|
+
+ mocks and stubs: moving minitest/mock.rb to its own gem
|
|
31
|
+
EOM
|
|
16
32
|
end
|
|
17
33
|
|
|
18
34
|
desc "Find missing expectations"
|
|
@@ -33,6 +49,7 @@ task :specs do
|
|
|
33
49
|
/_includes/ => "_include",
|
|
34
50
|
/(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
|
|
35
51
|
/must_raises/ => "must_raise",
|
|
52
|
+
/(must|wont)_pattern/ => '\1_pattern_match',
|
|
36
53
|
/(must|wont)_predicate/ => '\1_be',
|
|
37
54
|
/(must|wont)_path_exists/ => 'path_\1_exist',
|
|
38
55
|
}
|
|
@@ -72,4 +89,9 @@ task :bugs do
|
|
|
72
89
|
sh "for f in bug*.rb ; do echo $f; echo; #{Gem.ruby} -Ilib $f && rm $f ; done"
|
|
73
90
|
end
|
|
74
91
|
|
|
92
|
+
Minitest::TestTask.create :testW0 do |t|
|
|
93
|
+
t.warning = false
|
|
94
|
+
t.test_prelude = "$-w = nil"
|
|
95
|
+
end
|
|
96
|
+
|
|
75
97
|
# vim: syntax=Ruby
|
data/design_rationale.rb
CHANGED
|
@@ -2,25 +2,27 @@
|
|
|
2
2
|
###############################################################################
|
|
3
3
|
describe Thingy do # class TestThingy < Minitest::Test
|
|
4
4
|
before do # def setup
|
|
5
|
-
do_some_setup # super
|
|
6
|
-
end # do_some_setup
|
|
7
|
-
# end
|
|
8
|
-
it "should do the first thing" do #
|
|
9
|
-
1.must_equal 1 # def test_first_thing
|
|
10
|
-
end # assert_equal 1, 1
|
|
11
|
-
# end
|
|
12
|
-
describe SubThingy do # end
|
|
13
|
-
before do #
|
|
14
|
-
do_more_setup # class TestSubThingy < TestThingy
|
|
15
|
-
end # def setup
|
|
16
5
|
# super
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
do_some_setup # do_some_setup
|
|
7
|
+
end # end
|
|
8
|
+
#
|
|
9
|
+
it "should do the first thing" do # def test_first_thing
|
|
10
|
+
_(1).must_equal 1 # assert_equal 1, 1
|
|
11
|
+
end # end
|
|
23
12
|
# end
|
|
13
|
+
#
|
|
14
|
+
describe SubThingy do # class TestSubThingy < TestThingy
|
|
15
|
+
before do # def setup
|
|
16
|
+
# super
|
|
17
|
+
do_more_setup # do_more_setup
|
|
18
|
+
end # end
|
|
19
|
+
#
|
|
20
|
+
it "should do the second thing" do # def test_second_thing
|
|
21
|
+
_(2).must_equal 2 # assert_equal 2, 2
|
|
22
|
+
end # end
|
|
23
|
+
end # end
|
|
24
|
+
end #
|
|
25
|
+
#
|
|
24
26
|
###############################################################################
|
|
25
27
|
# runs 2 specs # runs 3 tests
|
|
26
28
|
###############################################################################
|
|
@@ -33,7 +35,7 @@ class ThingySpec < Minitest::Spec
|
|
|
33
35
|
end
|
|
34
36
|
|
|
35
37
|
def test_should_do_the_first_thing
|
|
36
|
-
|
|
38
|
+
_(1).must_equal 1
|
|
37
39
|
end
|
|
38
40
|
end
|
|
39
41
|
|
|
@@ -47,6 +49,6 @@ class SubThingySpec < ThingySpec
|
|
|
47
49
|
remove_method :test_should_do_the_first_thing
|
|
48
50
|
|
|
49
51
|
def test_should_do_the_second_thing
|
|
50
|
-
|
|
52
|
+
_(2).must_equal 2
|
|
51
53
|
end
|
|
52
54
|
end
|
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
|
|
@@ -10,13 +11,14 @@ module Hoe::Minitest
|
|
|
10
11
|
|
|
11
12
|
def initialize_minitest
|
|
12
13
|
unless minitest? then
|
|
13
|
-
dir = "
|
|
14
|
+
dir = File.expand_path "../..", __FILE__
|
|
15
|
+
|
|
14
16
|
Hoe.add_include_dirs dir if File.directory? dir
|
|
15
17
|
end
|
|
16
18
|
|
|
17
19
|
gem "minitest"
|
|
18
20
|
require "minitest"
|
|
19
|
-
version = Minitest::VERSION.split(
|
|
21
|
+
version = Minitest::VERSION.split(".").first(2).join "."
|
|
20
22
|
|
|
21
23
|
dependency "minitest", "~> #{version}", :development unless
|
|
22
24
|
minitest? or ENV["MT_NO_ISOLATE"]
|