minitest 5.27.0 → 6.0.3

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/History.rdoc +108 -0
  4. data/Manifest.txt +13 -4
  5. data/README.rdoc +8 -90
  6. data/Rakefile +7 -15
  7. data/bin/minitest +5 -0
  8. data/lib/minitest/assertions.rb +26 -55
  9. data/lib/minitest/autorun.rb +0 -1
  10. data/lib/minitest/benchmark.rb +1 -1
  11. data/lib/minitest/bisect.rb +304 -0
  12. data/lib/minitest/complete.rb +56 -0
  13. data/lib/minitest/find_minimal_combination.rb +127 -0
  14. data/lib/minitest/manual_plugins.rb +4 -16
  15. data/lib/minitest/parallel.rb +3 -3
  16. data/lib/minitest/path_expander.rb +432 -0
  17. data/lib/minitest/pride.rb +1 -1
  18. data/lib/minitest/server.rb +49 -0
  19. data/lib/minitest/server_plugin.rb +88 -0
  20. data/lib/minitest/spec.rb +2 -31
  21. data/lib/minitest/sprint.rb +105 -0
  22. data/lib/minitest/sprint_plugin.rb +39 -0
  23. data/lib/minitest/test.rb +5 -11
  24. data/lib/minitest/test_task.rb +16 -9
  25. data/lib/minitest.rb +69 -87
  26. data/test/minitest/metametameta.rb +1 -1
  27. data/test/minitest/test_bisect.rb +249 -0
  28. data/test/minitest/test_find_minimal_combination.rb +138 -0
  29. data/test/minitest/test_minitest_assertions.rb +36 -44
  30. data/test/minitest/test_minitest_benchmark.rb +14 -0
  31. data/test/minitest/test_minitest_spec.rb +38 -102
  32. data/test/minitest/test_minitest_test.rb +20 -99
  33. data/test/minitest/test_path_expander.rb +229 -0
  34. data/test/minitest/test_server.rb +146 -0
  35. data.tar.gz.sig +0 -0
  36. metadata +87 -41
  37. metadata.gz.sig +2 -3
  38. data/.autotest +0 -34
  39. data/lib/minitest/mock.rb +0 -327
  40. data/lib/minitest/unit.rb +0 -42
  41. data/test/minitest/test_minitest_mock.rb +0 -1213
@@ -0,0 +1,146 @@
1
+ require "minitest/autorun"
2
+ require_relative "../../lib/minitest/server"
3
+ require_relative "../../lib/minitest/server_plugin"
4
+
5
+ class BogoTests < Minitest::Test
6
+ def pass_test
7
+ assert true
8
+ end
9
+
10
+ def fail_test
11
+ assert false, "fail"
12
+ end
13
+
14
+ def error_test
15
+ raise "error"
16
+ end
17
+
18
+ def unmarshalable_ivar_test
19
+ raise "error"
20
+ rescue => e
21
+ e.instance_variable_set :@binding, binding
22
+ raise
23
+ end
24
+
25
+ def unmarshalable_class_test
26
+ exc = Class.new RuntimeError
27
+ raise exc, "error"
28
+ rescue => e
29
+ e.instance_variable_set :@binding, binding
30
+ raise
31
+ end
32
+
33
+ def wtf_test
34
+ assert false, "wtf"
35
+ rescue Minitest::Assertion => e
36
+ e.instance_variable_set :@proc, proc { 42 }
37
+ raise e
38
+ end
39
+ end
40
+
41
+ class TestServerReporter < Minitest::ServerReporter
42
+ def record o
43
+ super
44
+
45
+ Marshal.dump o
46
+ end
47
+ end
48
+
49
+ class Client
50
+ def run pid, type
51
+ reporter = TestServerReporter.new pid
52
+
53
+ unless Minitest.respond_to? :run_one_method then # MT6
54
+ BogoTests.run BogoTests, "#{type}_test", reporter
55
+ else
56
+ reporter.start
57
+ reporter.record Minitest.run_one_method(BogoTests, "#{type}_test")
58
+ end
59
+ end
60
+ end
61
+
62
+ class Server
63
+ attr_accessor :results
64
+
65
+ def self.run type = nil
66
+ s = self.new
67
+ s.run type
68
+ s.results
69
+ end
70
+
71
+ def run type = nil
72
+ Minitest::Server.run self
73
+
74
+ Client.new.run $$, type
75
+ ensure
76
+ Minitest::Server.stop
77
+ end
78
+
79
+ def minitest_start
80
+ # do nothing
81
+ end
82
+
83
+ def minitest_result(*vals)
84
+ self.results = vals
85
+ end
86
+ end
87
+
88
+ class ServerTest < Minitest::Test
89
+ def test_pass
90
+ assert_run "pass", [], 1
91
+ end
92
+
93
+ def test_fail
94
+ assert_run "fail", ["fail"], 1
95
+ end
96
+
97
+ FILE = __FILE__.delete_prefix "#{Dir.pwd}/"
98
+
99
+ def test_error
100
+ msg = <<~EOM.chomp
101
+ RuntimeError: error
102
+ #{FILE}:##:in `error_test'
103
+ EOM
104
+
105
+ assert_run "error", [msg], 0
106
+ end
107
+
108
+ def test_error_unmarshalable__ivar
109
+ msg = <<~EOM.chomp
110
+ RuntimeError: error
111
+ #{FILE}:##:in `unmarshalable_ivar_test'
112
+ EOM
113
+
114
+ assert_run "unmarshalable_ivar", [msg], 0
115
+ end
116
+
117
+ def test_error_unmarshalable__class
118
+ msg = <<~EOM.chomp
119
+ RuntimeError: Neutered Exception #<Class:0xXXXXXX>: error
120
+ #{FILE}:##:in `unmarshalable_class_test'
121
+ EOM
122
+
123
+ assert_run "unmarshalable_class", [msg], 0
124
+ end
125
+
126
+ def test_wtf
127
+ assert_run "wtf", ["wtf"], 1
128
+ end
129
+
130
+ def assert_run type, e, n
131
+ e[0] = e[0].sub "`", "'BogoTests#" if RUBY_VERSION > "3.4" if e[0]
132
+
133
+ # client.minitest_result file, klass, method, fails, assertions, time
134
+ f, k, m, (msg,), a, _time = Server.run type
135
+
136
+ msg &&= msg
137
+ .message
138
+ .gsub(/0x\h+/, "0xXXXXXX")
139
+ .gsub(/:\d{2,}/, ":##")
140
+
141
+ act = [f, k, m, [msg].compact, a, 0]
142
+ exp = ["test/minitest/test_server.rb", "BogoTests", "#{type}_test", e, n, 0]
143
+
144
+ assert_equal exp, act
145
+ end
146
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.27.0
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -9,9 +9,9 @@ bindir: bin
9
9
  cert_chain:
10
10
  - |
11
11
  -----BEGIN CERTIFICATE-----
12
- MIIDPjCCAiagAwIBAgIBCTAN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KsLjJly/Theak+euNTxvHsB+
29
- al9oSgPPHICMEX65qvLywitx
24
+ AQA/X8/PKTTc/IkYQEUL6XWtfK8fAfbuLJzmLcz6f2ZWrtBvPsYvqRuwI1bWUtil
25
+ 2ibJEfIuSIHX6BsUTX18+hlaIussf6EWq/YkE7e2BKmgQE42vSOZMce0kCEAPbx0
26
+ rQtqonfWTHQ8UbQ7GqCL3gDQ0QDD2B+HUlb4uaCZ2icxqa/eOtxMvHC2tj+h0xKY
27
+ xL84ipM5kr0bHGf9/MRZJWcw51urueNycBXu1Xh+pEN8qBmYsFRR4SIODLClybAO
28
+ 6cbm2PyPQgKNiqE4H+IQrDVHd9bJs1XgLElk3qoaJBWXc/5fy0J1imYb25UqmiHG
29
+ snGe1hrppvBRdcyEzvhfIPjI
30
30
  -----END CERTIFICATE-----
31
31
  date: 1980-01-02 00:00:00.000000000 Z
32
32
  dependencies:
33
+ - !ruby/object:Gem::Dependency
34
+ name: prism
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.5'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.5'
47
+ - !ruby/object:Gem::Dependency
48
+ name: drb
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.0'
33
61
  - !ruby/object:Gem::Dependency
34
62
  name: rdoc
35
63
  requirement: !ruby/object:Gem::Requirement
36
64
  requirements:
37
65
  - - ">="
38
66
  - !ruby/object:Gem::Version
39
- version: '4.0'
67
+ version: '6.0'
40
68
  - - "<"
41
69
  - !ruby/object:Gem::Version
42
- version: '7'
70
+ version: '8'
43
71
  type: :development
44
72
  prerelease: false
45
73
  version_requirements: !ruby/object:Gem::Requirement
46
74
  requirements:
47
75
  - - ">="
48
76
  - !ruby/object:Gem::Version
49
- version: '4.0'
77
+ version: '6.0'
50
78
  - - "<"
51
79
  - !ruby/object:Gem::Version
52
- version: '7'
80
+ version: '8'
81
+ - !ruby/object:Gem::Dependency
82
+ name: simplecov
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '0.21'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '0.21'
53
95
  - !ruby/object:Gem::Dependency
54
96
  name: hoe
55
97
  requirement: !ruby/object:Gem::Requirement
56
98
  requirements:
57
99
  - - "~>"
58
100
  - !ruby/object:Gem::Version
59
- version: '4.3'
101
+ version: '4.6'
60
102
  type: :development
61
103
  prerelease: false
62
104
  version_requirements: !ruby/object:Gem::Requirement
63
105
  requirements:
64
106
  - - "~>"
65
107
  - !ruby/object:Gem::Version
66
- version: '4.3'
108
+ version: '4.6'
67
109
  description: |-
68
110
  minitest provides a complete suite of testing facilities supporting
69
- TDD, BDD, mocking, and benchmarking.
111
+ TDD, BDD, and benchmarking.
70
112
 
71
113
  "I had a class with Jim Weirich on testing last week and we were
72
114
  allowed to choose our testing frameworks. Kirk Haines and I were
@@ -92,9 +134,6 @@ description: |-
92
134
  co-worker doesn't replace your linear algorithm with an exponential
93
135
  one!
94
136
 
95
- minitest/mock by Steven Baker, is a beautifully tiny mock (and stub)
96
- object framework.
97
-
98
137
  minitest/pride shows pride in testing and adds coloring to your test
99
138
  output. I guess it is an example of how to write IO pipes too. :P
100
139
 
@@ -118,47 +157,68 @@ description: |-
118
157
  classes, modules, inheritance, methods. This means you only have to
119
158
  learn ruby to use minitest and all of your regular OO practices like
120
159
  extract-method refactorings still apply.
160
+
161
+ == Features/Problems:
162
+
163
+ * minitest/autorun - the easy and explicit way to run all your tests.
164
+ * minitest/test - a very fast, simple, and clean test system.
165
+ * minitest/spec - a very fast, simple, and clean spec system.
166
+ * minitest/benchmark - an awesome way to assert your algorithm's performance.
167
+ * minitest/pride - show your pride in testing!
168
+ * minitest/test_task - a full-featured and clean rake task generator.
169
+ * Incredibly small and fast runner, but no bells and whistles.
170
+ * Written by squishy human beings. Software can never be perfect. We will all eventually die.
121
171
  email:
122
172
  - ryand-ruby@zenspider.com
123
- executables: []
173
+ executables:
174
+ - minitest
124
175
  extensions: []
125
176
  extra_rdoc_files:
126
177
  - History.rdoc
127
178
  - Manifest.txt
128
179
  - README.rdoc
129
180
  files:
130
- - ".autotest"
131
181
  - History.rdoc
132
182
  - Manifest.txt
133
183
  - README.rdoc
134
184
  - Rakefile
185
+ - bin/minitest
135
186
  - design_rationale.rb
136
187
  - lib/hoe/minitest.rb
137
188
  - lib/minitest.rb
138
189
  - lib/minitest/assertions.rb
139
190
  - lib/minitest/autorun.rb
140
191
  - lib/minitest/benchmark.rb
192
+ - lib/minitest/bisect.rb
193
+ - lib/minitest/complete.rb
141
194
  - lib/minitest/compress.rb
142
195
  - lib/minitest/error_on_warning.rb
143
196
  - lib/minitest/expectations.rb
197
+ - lib/minitest/find_minimal_combination.rb
144
198
  - lib/minitest/hell.rb
145
199
  - lib/minitest/manual_plugins.rb
146
- - lib/minitest/mock.rb
147
200
  - lib/minitest/parallel.rb
201
+ - lib/minitest/path_expander.rb
148
202
  - lib/minitest/pride.rb
149
203
  - lib/minitest/pride_plugin.rb
204
+ - lib/minitest/server.rb
205
+ - lib/minitest/server_plugin.rb
150
206
  - lib/minitest/spec.rb
207
+ - lib/minitest/sprint.rb
208
+ - lib/minitest/sprint_plugin.rb
151
209
  - lib/minitest/test.rb
152
210
  - lib/minitest/test_task.rb
153
- - lib/minitest/unit.rb
154
211
  - test/minitest/metametameta.rb
212
+ - test/minitest/test_bisect.rb
213
+ - test/minitest/test_find_minimal_combination.rb
155
214
  - test/minitest/test_minitest_assertions.rb
156
215
  - test/minitest/test_minitest_benchmark.rb
157
- - test/minitest/test_minitest_mock.rb
158
216
  - test/minitest/test_minitest_reporter.rb
159
217
  - test/minitest/test_minitest_spec.rb
160
218
  - test/minitest/test_minitest_test.rb
161
219
  - test/minitest/test_minitest_test_task.rb
220
+ - test/minitest/test_path_expander.rb
221
+ - test/minitest/test_server.rb
162
222
  homepage: https://minite.st/
163
223
  licenses:
164
224
  - MIT
@@ -166,22 +226,8 @@ metadata:
166
226
  homepage_uri: https://minite.st/
167
227
  source_code_uri: https://github.com/minitest/minitest
168
228
  bug_tracker_uri: https://github.com/minitest/minitest/issues
229
+ documentation_uri: https://docs.seattlerb.org/minitest
169
230
  changelog_uri: https://github.com/minitest/minitest/blob/master/History.rdoc
170
- post_install_message: |
171
- NOTE: minitest 5 will be the last in the minitest family to support
172
- ruby 1.8 to 2.7. If you need to keep using these versions,
173
- you need to pin your dependency to minitest with something
174
- like "~> 5.0". See History.rdoc to locate compatible
175
- versions.
176
-
177
- Further, minitest 6 will be dropping the following:
178
-
179
- + MiniTest (it's been Minitest for >10 years)
180
- + MiniTest::Unit
181
- + MiniTest::Unit::TestCase
182
- + assert_send (unless you argue for it well)
183
- + assert_equal nil, obj
184
- + mocks and stubs: moving minitest/mock.rb to its own gem
185
231
  rdoc_options:
186
232
  - "--main"
187
233
  - README.rdoc
@@ -191,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
237
  requirements:
192
238
  - - ">="
193
239
  - !ruby/object:Gem::Version
194
- version: '3.1'
240
+ version: '3.2'
195
241
  required_rubygems_version: !ruby/object:Gem::Requirement
196
242
  requirements:
197
243
  - - ">="
@@ -201,5 +247,5 @@ requirements: []
201
247
  rubygems_version: 3.7.2
202
248
  specification_version: 4
203
249
  summary: minitest provides a complete suite of testing facilities supporting TDD,
204
- BDD, mocking, and benchmarking
250
+ BDD, and benchmarking
205
251
  test_files: []
metadata.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- �&#��T�d���pV ��M����F�e��s�������Έ�&o��5Eȿ3He��Ǘ�t�>h�E!�1W;rl��}�Y�f
2
- ��J�;�&��'*pU�'��
3
- ������8�b�Q6��-p����N5-4�=��L 5�{#�a[�&��*����|�1��,���y˰p 2*`�Aӊ���Rf�N
1
+ .���kP�vE(����� �<���w��I6���������,Ł�Y'�Wz'#K1�[����Sh��܎�+�Đ��������*=�Ä}���fi@x#��De'2���#��H�e�~��t����&�ڮOu���m+eDzI|JO��w'�\�U����v��3�����=.i��TڿE�f�y- &����羶_B�.o�Y��͢��z4��Jv|��̞O)��CWb�N���V�疒�����x
2
+ �>
data/.autotest DELETED
@@ -1,34 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'autotest/restart'
4
- require 'autotest/rcov' if ENV['RCOV']
5
-
6
- Autotest.add_hook :initialize do |at|
7
- at.testlib = 'minitest/autorun'
8
-
9
- bench_tests = %w(TestMinitestBenchmark)
10
- mock_tests = %w(TestMinitestMock TestMinitestStub)
11
- spec_tests = %w(TestMinitestReporter TestMetaStatic TestMeta
12
- TestSpecInTestCase)
13
- unit_tests = %w(TestMinitestGuard TestMinitestRunnable
14
- TestMinitestRunner TestMinitestTest TestMinitestUnit
15
- TestMinitestUnitInherited TestMinitestUnitOrder
16
- TestMinitestUnitRecording TestMinitestUnitTestCase)
17
-
18
- {
19
- bench_tests => "test/minitest/test_minitest_benchmark.rb",
20
- mock_tests => "test/minitest/test_minitest_mock.rb",
21
- spec_tests => "test/minitest/test_minitest_reporter.rb",
22
- unit_tests => "test/minitest/test_minitest_unit.rb",
23
- }.each do |klasses, file|
24
- klasses.each do |klass|
25
- at.extra_class_map[klass] = file
26
- end
27
- end
28
-
29
- at.add_exception 'coverage.info'
30
- at.add_exception 'coverage'
31
- end
32
-
33
- # require 'autotest/rcov'
34
- # Autotest::RCov.command = 'rcov_info'