minitest 5.26.0 → 6.0.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/History.rdoc +95 -0
  4. data/Manifest.txt +13 -4
  5. data/README.rdoc +18 -98
  6. data/Rakefile +7 -1
  7. data/bin/minitest +5 -0
  8. data/design_rationale.rb +21 -19
  9. data/lib/hoe/minitest.rb +2 -1
  10. data/lib/minitest/assertions.rb +34 -66
  11. data/lib/minitest/autorun.rb +3 -4
  12. data/lib/minitest/benchmark.rb +2 -2
  13. data/lib/minitest/bisect.rb +306 -0
  14. data/lib/minitest/complete.rb +56 -0
  15. data/lib/minitest/find_minimal_combination.rb +127 -0
  16. data/lib/minitest/hell.rb +1 -1
  17. data/lib/minitest/manual_plugins.rb +4 -16
  18. data/lib/minitest/parallel.rb +5 -3
  19. data/lib/minitest/path_expander.rb +418 -0
  20. data/lib/minitest/pride.rb +2 -2
  21. data/lib/minitest/pride_plugin.rb +1 -1
  22. data/lib/minitest/server.rb +45 -0
  23. data/lib/minitest/server_plugin.rb +84 -0
  24. data/lib/minitest/spec.rb +5 -33
  25. data/lib/minitest/sprint.rb +104 -0
  26. data/lib/minitest/sprint_plugin.rb +39 -0
  27. data/lib/minitest/test.rb +7 -13
  28. data/lib/minitest/test_task.rb +6 -13
  29. data/lib/minitest.rb +86 -101
  30. data/test/minitest/metametameta.rb +1 -1
  31. data/test/minitest/test_bisect.rb +235 -0
  32. data/test/minitest/test_find_minimal_combination.rb +138 -0
  33. data/test/minitest/test_minitest_assertions.rb +48 -105
  34. data/test/minitest/test_minitest_reporter.rb +6 -5
  35. data/test/minitest/test_minitest_spec.rb +52 -118
  36. data/test/minitest/test_minitest_test.rb +21 -100
  37. data/test/minitest/test_path_expander.rb +229 -0
  38. data/test/minitest/test_server.rb +149 -0
  39. data.tar.gz.sig +1 -2
  40. metadata +50 -17
  41. metadata.gz.sig +2 -2
  42. data/.autotest +0 -34
  43. data/lib/minitest/mock.rb +0 -347
  44. data/lib/minitest/unit.rb +0 -42
  45. data/test/minitest/test_minitest_mock.rb +0 -1218
@@ -1,5 +1,5 @@
1
1
  require "minitest/autorun"
2
- require "minitest/metametameta"
2
+ require_relative "metametameta"
3
3
  require "forwardable"
4
4
 
5
5
  class FakeTest < Minitest::Test
@@ -29,10 +29,11 @@ class TestMinitestReporter < MetaMetaMetaTestCase
29
29
  super
30
30
  self.io = StringIO.new(+"")
31
31
  self.r = new_composite_reporter
32
+ @et = @ft = @pt = @st = @sse = nil
32
33
  end
33
34
 
34
35
  def error_test
35
- unless defined? @et then
36
+ unless @et then
36
37
  @et = FakeTest.new :woot
37
38
  @et.failures << Minitest::UnexpectedError.new(begin
38
39
  raise "no"
@@ -45,7 +46,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
45
46
  end
46
47
 
47
48
  def system_stack_error_test
48
- unless defined? @sse then
49
+ unless @sse then
49
50
 
50
51
  ex = SystemStackError.new
51
52
 
@@ -64,7 +65,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
64
65
  end
65
66
 
66
67
  def fail_test
67
- unless defined? @ft then
68
+ unless @ft then
68
69
  @ft = FakeTest.new :woot
69
70
  @ft.failures << begin
70
71
  raise Minitest::Assertion, "boo"
@@ -87,7 +88,7 @@ class TestMinitestReporter < MetaMetaMetaTestCase
87
88
  end
88
89
 
89
90
  def skip_test
90
- unless defined? @st then
91
+ unless @st then
91
92
  @st = FakeTest.new :woot
92
93
  @st.failures << begin
93
94
  raise Minitest::Skip
@@ -1,4 +1,4 @@
1
- require "minitest/metametameta"
1
+ require_relative "metametameta"
2
2
  require "stringio"
3
3
 
4
4
  class MiniSpecA < Minitest::Spec; end
@@ -108,7 +108,7 @@ describe Minitest::Spec do
108
108
  end
109
109
 
110
110
  it "needs to catch an expected exception" do
111
- @assertion_count = 2
111
+ @assertion_count -= 2
112
112
 
113
113
  expect { raise "blah" }.must_raise RuntimeError
114
114
  expect { raise Minitest::Assertion }.must_raise Minitest::Assertion
@@ -148,25 +148,13 @@ describe Minitest::Spec do
148
148
  it "needs to pattern match" do
149
149
  @assertion_count = 1
150
150
 
151
- if RUBY_VERSION > "3" then
152
- expect { good_pattern }.must_pattern_match
153
- else
154
- assert_raises NotImplementedError do
155
- expect {}.must_pattern_match
156
- end
157
- end
151
+ expect { good_pattern }.must_pattern_match
158
152
  end
159
153
 
160
154
  it "needs to error on bad pattern match" do
161
- skip unless RUBY_VERSION > "3"
162
-
163
155
  @assertion_count = 1
164
156
 
165
- exp = if RUBY_VERSION.start_with? "3.0"
166
- "[1, 2, 3]" # terrible error message!
167
- else
168
- /length mismatch/
169
- end
157
+ exp = /length mismatch/
170
158
 
171
159
  assert_triggered exp do
172
160
  expect { bad_pattern }.must_pattern_match
@@ -212,11 +200,16 @@ describe Minitest::Spec do
212
200
  must_raise
213
201
  must_respond_to
214
202
  must_throw
215
- must_verify
216
203
  path_must_exist]
217
204
 
218
205
  bad = %w[not raise throw send output be_silent verify]
219
206
 
207
+ if methods.include? "must_infect" then # from test_minitest_mock.rb
208
+ expected_musts += %w[must_infect must_infect_without_flipping]
209
+ expected_musts.sort!
210
+ bad << "infect"
211
+ end
212
+
220
213
  expected_wonts = expected_musts.map { |m| m.sub("must", "wont") }.sort
221
214
  expected_wonts.reject! { |m| m =~ /wont_#{Regexp.union(*bad)}/ }
222
215
 
@@ -237,6 +230,8 @@ describe Minitest::Spec do
237
230
  end
238
231
 
239
232
  it "needs to verify binary messages" do
233
+ @assertion_count += 3
234
+
240
235
  assert_success _(42).wont_be(:<, 24)
241
236
 
242
237
  assert_triggered "Expected 24 to not be < 42." do
@@ -280,15 +275,9 @@ describe Minitest::Spec do
280
275
  end
281
276
  end
282
277
 
283
- it "needs to warn on equality with nil" do
284
- @assertion_count = 3
285
- @assertion_count += 2 unless error_on_warn? # 2 extra assertions
286
-
287
- exp = /DEPRECATED: Use assert_nil if expecting nil from .* This will fail in Minitest 6./
288
-
289
- assert_deprecation exp do
290
- assert_success _(nil).must_equal(nil)
291
- end
278
+ it "needs to fail on equality with nil" do
279
+ @assertion_count -= 2
280
+ expect { _(nil).must_equal(nil) }.must_raise Minitest::Assertion
292
281
  end
293
282
 
294
283
  it "needs to verify floats outside a delta" do
@@ -300,12 +289,11 @@ describe Minitest::Spec do
300
289
  _(6 * 7.0).wont_be_close_to 42
301
290
  end
302
291
 
303
- x = "1.0e-05"
304
- assert_triggered "Expected |42 - 42.0| (0.0) to not be <= #{x}." do
292
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be <= 1.0e-05." do
305
293
  _(6 * 7.0).wont_be_close_to 42, 0.00001
306
294
  end
307
295
 
308
- assert_triggered "msg.\nExpected |42 - 42.0| (0.0) to not be <= #{x}." do
296
+ assert_triggered "msg.\nExpected |42 - 42.0| (0.0) to not be <= 1.0e-05." do
309
297
  _(6 * 7.0).wont_be_close_to 42, 0.00001, "msg"
310
298
  end
311
299
  end
@@ -315,17 +303,15 @@ describe Minitest::Spec do
315
303
 
316
304
  assert_success _(24).wont_be_within_epsilon(42)
317
305
 
318
- x = "0.042"
319
- assert_triggered "Expected |42 - 42.0| (0.0) to not be <= #{x}." do
306
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be <= 0.042." do
320
307
  _(6 * 7.0).wont_be_within_epsilon 42
321
308
  end
322
309
 
323
- x = "0.00042"
324
- assert_triggered "Expected |42 - 42.0| (0.0) to not be <= #{x}." do
310
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be <= 0.00042." do
325
311
  _(6 * 7.0).wont_be_within_epsilon 42, 0.00001
326
312
  end
327
313
 
328
- assert_triggered "msg.\nExpected |42 - 42.0| (0.0) to not be <= #{x}." do
314
+ assert_triggered "msg.\nExpected |42 - 42.0| (0.0) to not be <= 0.00042." do
329
315
  _(6 * 7.0).wont_be_within_epsilon 42, 0.00001, "msg"
330
316
  end
331
317
  end
@@ -339,12 +325,11 @@ describe Minitest::Spec do
339
325
  _(1.0 / 100).must_be_close_to 0.0
340
326
  end
341
327
 
342
- x = "1.0e-06"
343
- assert_triggered "Expected |0.0 - 0.001| (0.001) to be <= #{x}." do
328
+ assert_triggered "Expected |0.0 - 0.001| (0.001) to be <= 1.0e-06." do
344
329
  _(1.0 / 1000).must_be_close_to 0.0, 0.000001
345
330
  end
346
331
 
347
- assert_triggered "msg.\nExpected |0.0 - 0.001| (0.001) to be <= #{x}." do
332
+ assert_triggered "msg.\nExpected |0.0 - 0.001| (0.001) to be <= 1.0e-06." do
348
333
  _(1.0 / 1000).must_be_close_to 0.0, 0.000001, "msg"
349
334
  end
350
335
  end
@@ -566,67 +551,6 @@ describe Minitest::Spec do
566
551
  it "can use expect in a thread" do
567
552
  Thread.new { _(1 + 1).must_equal 2 }.join
568
553
  end
569
-
570
- it "can NOT use must_equal in a thread. It must use expect in a thread" do
571
- skip "N/A" if ENV["MT_NO_EXPECTATIONS"]
572
-
573
- assert_raises RuntimeError, Minitest::UnexpectedWarning do
574
- capture_io do
575
- Thread.new { (1 + 1).must_equal 2 }.join
576
- end
577
- end
578
- end
579
-
580
- it "fails gracefully when expectation used outside of `it`" do
581
- skip "N/A" if ENV["MT_NO_EXPECTATIONS"]
582
-
583
- @assertion_count += 2 # assert_match is compound
584
-
585
- e = assert_raises RuntimeError, Minitest::UnexpectedWarning do
586
- capture_io do
587
- Thread.new { # forces ctx to be nil
588
- describe "woot" do
589
- (1 + 1).must_equal 2
590
- end
591
- }.join
592
- end
593
- end
594
-
595
- exp = "Calling #must_equal outside of test."
596
- exp = "DEPRECATED: global use of must_equal from" if error_on_warn?
597
-
598
- assert_match exp, e.message
599
- end
600
-
601
- it "deprecates expectation used without _" do
602
- skip "N/A" if ENV["MT_NO_EXPECTATIONS"]
603
-
604
- @assertion_count += 1
605
- @assertion_count += 2 unless error_on_warn?
606
-
607
- exp = /DEPRECATED: global use of must_equal from/
608
-
609
- assert_deprecation exp do
610
- (1 + 1).must_equal 2
611
- end
612
- end
613
-
614
- # https://github.com/seattlerb/minitest/issues/837
615
- # https://github.com/rails/rails/pull/39304
616
- it "deprecates expectation used without _ with empty backtrace_filter" do
617
- skip "N/A" if ENV["MT_NO_EXPECTATIONS"]
618
-
619
- @assertion_count += 1
620
- @assertion_count += 2 unless error_on_warn?
621
-
622
- exp = /DEPRECATED: global use of must_equal from/
623
-
624
- with_empty_backtrace_filter do
625
- assert_deprecation exp do
626
- (1 + 1).must_equal 2
627
- end
628
- end
629
- end
630
554
  end
631
555
 
632
556
  it "needs to verify throw" do
@@ -667,7 +591,7 @@ describe Minitest::Spec do
667
591
  end
668
592
 
669
593
  it "needs to verify using any (negative) predicate" do
670
- @assertion_count -= 1 # doesn"t take a message
594
+ @assertion_count += 1
671
595
 
672
596
  assert_success _("blah").wont_be(:empty?)
673
597
 
@@ -677,7 +601,7 @@ describe Minitest::Spec do
677
601
  end
678
602
 
679
603
  it "needs to verify using any binary operator" do
680
- @assertion_count -= 1 # no msg
604
+ @assertion_count += 1
681
605
 
682
606
  assert_success _(41).must_be(:<, 42)
683
607
 
@@ -687,7 +611,7 @@ describe Minitest::Spec do
687
611
  end
688
612
 
689
613
  it "needs to verify using any predicate" do
690
- @assertion_count -= 1 # no msg
614
+ @assertion_count += 1
691
615
 
692
616
  assert_success _("").must_be(:empty?)
693
617
 
@@ -939,6 +863,16 @@ class TestMeta < MetaMetaMetaTestCase
939
863
  assert_equal "ExampleB::random_method::addl_context", spec_c.name
940
864
  end
941
865
 
866
+ def test_inspect
867
+ spec_a = describe ExampleA do; end
868
+ spec_b = describe ExampleB, :random_method do; end
869
+ spec_c = describe ExampleB, :random_method, :addl_context do; end
870
+
871
+ assert_equal "ExampleA", spec_a.inspect
872
+ assert_equal "ExampleB::random_method", spec_b.inspect
873
+ assert_equal "ExampleB::random_method::addl_context", spec_c.inspect
874
+ end
875
+
942
876
  def test_name2
943
877
  assert_equal "NamedExampleA", NamedExampleA.name
944
878
  assert_equal "NamedExampleB", NamedExampleB.name
@@ -1126,36 +1060,36 @@ class ValueMonadTest < Minitest::Test
1126
1060
  end
1127
1061
 
1128
1062
  describe Minitest::Spec, :infect_an_assertion do
1129
- class << self
1130
- attr_accessor :infect_mock
1063
+ attr_accessor :infect_mock
1064
+
1065
+ before do
1066
+ mock = Object.new
1067
+ mock.singleton_class.attr_accessor :a, :k
1068
+ def mock.assert_infects *args, **kwargs
1069
+ self.a, self.k = args, kwargs
1070
+ end
1071
+
1072
+ self.infect_mock = mock
1131
1073
  end
1132
1074
 
1133
1075
  def assert_infects exp, act, msg = nil, foo: nil, bar: nil
1134
- self.class.infect_mock.assert_infects exp, act, msg, foo: foo, bar: bar
1076
+ self.infect_mock.assert_infects exp, act, msg, foo: foo, bar: bar
1135
1077
  end
1136
1078
 
1137
- infect_an_assertion :assert_infects, :must_infect
1138
- infect_an_assertion :assert_infects, :must_infect_without_flipping, :dont_flip
1079
+ Minitest::Expectations.infect_an_assertion :assert_infects, :must_infect
1080
+ Minitest::Expectations.infect_an_assertion :assert_infects, :must_infect_without_flipping, :dont_flip
1139
1081
 
1140
1082
  it "infects assertions with kwargs" do
1141
- mock = Minitest::Mock.new
1142
- mock.expect :assert_infects, true, [:exp, :act, nil], foo: :foo, bar: :bar
1143
-
1144
- self.class.infect_mock = mock
1145
-
1146
1083
  _(:act).must_infect :exp, foo: :foo, bar: :bar
1147
1084
 
1148
- assert_mock mock
1085
+ assert_equal [:exp, :act, nil], infect_mock.a
1086
+ assert_equal({foo: :foo, bar: :bar}, infect_mock.k)
1149
1087
  end
1150
1088
 
1151
1089
  it "infects assertions with kwargs (dont_flip)" do
1152
- mock = Minitest::Mock.new
1153
- mock.expect :assert_infects, true, [:act, :exp, nil], foo: :foo, bar: :bar
1154
-
1155
- self.class.infect_mock = mock
1156
-
1157
1090
  _(:act).must_infect_without_flipping :exp, foo: :foo, bar: :bar
1158
1091
 
1159
- assert_mock mock
1092
+ assert_equal [:act, :exp, nil], infect_mock.a
1093
+ assert_equal({foo: :foo, bar: :bar}, infect_mock.k)
1160
1094
  end
1161
1095
  end
@@ -1,4 +1,4 @@
1
- require "minitest/metametameta"
1
+ require_relative "metametameta"
2
2
 
3
3
  e = Encoding.default_external
4
4
  if e != Encoding::UTF_8 then
@@ -342,6 +342,20 @@ class TestMinitestRunner < MetaMetaMetaTestCase
342
342
  assert_instance_of Integer, Minitest.seed
343
343
  end
344
344
 
345
+ def test_filter_runnable_methods
346
+ cls = Class.new Minitest::Runnable
347
+ def cls.runnable_methods
348
+ %w[ x y z ]
349
+ end
350
+
351
+ assert_equal %w[x y z], cls.filter_runnable_methods
352
+ assert_equal %w[x y], cls.filter_runnable_methods(exclude: "z")
353
+ assert_equal %w[x], cls.filter_runnable_methods(include: "x")
354
+
355
+ assert_empty cls.filter_runnable_methods(exclude: "/./")
356
+ assert_empty cls.filter_runnable_methods(include: "x", exclude: "x")
357
+ end
358
+
345
359
  def test_run_failing_filtered
346
360
  setup_basic_tu
347
361
 
@@ -566,7 +580,7 @@ class TestMinitestRunner < MetaMetaMetaTestCase
566
580
 
567
581
  def test_run_with_other_runner
568
582
  @tu = Class.new FakeNamedTest do
569
- def self.run reporter, options = {}
583
+ def self.run_suite reporter, options = {}
570
584
  @reporter = reporter
571
585
  before_my_suite
572
586
  super
@@ -795,40 +809,6 @@ class BetterError < RuntimeError # like better_error w/o infecting RuntimeError
795
809
  end
796
810
 
797
811
  class TestMinitestRunnable < Minitest::Test
798
- def setup_marshal klass
799
- tc = klass.new "whatever"
800
- tc.assertions = 42
801
- tc.failures << "a failure"
802
-
803
- yield tc if block_given?
804
-
805
- def tc.setup
806
- @blah = "blah"
807
- end
808
- tc.setup
809
-
810
- @tc = Minitest::Result.from tc
811
- end
812
-
813
- def assert_marshal expected_ivars
814
- new_tc = Marshal.load Marshal.dump @tc
815
-
816
- ivars = new_tc.instance_variables.map(&:to_s).sort
817
- ivars.delete "@gc_stats" # only needed if running w/ minitest-gcstats
818
- assert_equal expected_ivars, ivars
819
- assert_equal "whatever", new_tc.name
820
- assert_equal 42, new_tc.assertions
821
- assert_equal ["a failure"], new_tc.failures
822
-
823
- yield new_tc if block_given?
824
- end
825
-
826
- def test_marshal
827
- setup_marshal Minitest::Runnable
828
-
829
- assert_marshal %w[@NAME @assertions @failures @klass @source_location @time]
830
- end
831
-
832
812
  def test_spec_marshal
833
813
  klass = describe("whatever") { it("passes") { assert true } }
834
814
  rm = klass.runnable_methods.first
@@ -988,18 +968,6 @@ class TestMinitestRunnable < Minitest::Test
988
968
  end
989
969
  end
990
970
 
991
- class TestMinitestTest < TestMinitestRunnable
992
- def test_dup
993
- setup_marshal Minitest::Test do |tc|
994
- tc.time = 3.14
995
- end
996
-
997
- assert_marshal %w[@NAME @assertions @failures @klass @source_location @time] do |new_tc|
998
- assert_in_epsilon 3.14, new_tc.time
999
- end
1000
- end
1001
- end
1002
-
1003
971
  class TestMinitestUnitTestCase < Minitest::Test
1004
972
  # do not call parallelize_me! - teardown accesses @tc._assertions
1005
973
  # which is not threadsafe. Nearly every method in here is an
@@ -1017,7 +985,7 @@ class TestMinitestUnitTestCase < Minitest::Test
1017
985
 
1018
986
  def teardown
1019
987
  assert_equal(@assertion_count, @tc.assertions,
1020
- "expected #{@assertion_count} assertions to be fired during the test, not #{@tc.assertions}") if @tc.passed?
988
+ message { "expected #{@assertion_count} assertions to be fired during the test, not #{@tc.assertions}" }) if @tc.passed?
1021
989
  end
1022
990
 
1023
991
  def non_verbose
@@ -1054,7 +1022,7 @@ class TestMinitestUnitTestCase < Minitest::Test
1054
1022
  @assertion_count = 0
1055
1023
 
1056
1024
  sample_test_case = Class.new FakeNamedTest do
1057
- def self.test_order; :sorted end
1025
+ def self.run_order; :sorted end
1058
1026
  def test_test3; assert "does not matter" end
1059
1027
  def test_test2; assert "does not matter" end
1060
1028
  def test_test1; assert "does not matter" end
@@ -1064,14 +1032,14 @@ class TestMinitestUnitTestCase < Minitest::Test
1064
1032
  assert_equal expected, sample_test_case.runnable_methods
1065
1033
  end
1066
1034
 
1067
- def test_i_suck_and_my_tests_are_order_dependent_bang_sets_test_order_alpha
1035
+ def test_i_suck_and_my_tests_are_order_dependent_bang_sets_run_order_alpha
1068
1036
  @assertion_count = 0
1069
1037
 
1070
1038
  shitty_test_case = Class.new FakeNamedTest
1071
1039
 
1072
1040
  shitty_test_case.i_suck_and_my_tests_are_order_dependent!
1073
1041
 
1074
- assert_equal :alpha, shitty_test_case.test_order
1042
+ assert_equal :alpha, shitty_test_case.run_order
1075
1043
  end
1076
1044
 
1077
1045
  def test_i_suck_and_my_tests_are_order_dependent_bang_does_not_warn
@@ -1079,7 +1047,7 @@ class TestMinitestUnitTestCase < Minitest::Test
1079
1047
 
1080
1048
  shitty_test_case = Class.new FakeNamedTest
1081
1049
 
1082
- def shitty_test_case.test_order; :lol end
1050
+ def shitty_test_case.run_order; :lol end
1083
1051
 
1084
1052
  assert_silent do
1085
1053
  shitty_test_case.i_suck_and_my_tests_are_order_dependent!
@@ -1124,24 +1092,6 @@ class TestMinitestGuard < Minitest::Test
1124
1092
  assert self.jruby? "java"
1125
1093
  end
1126
1094
 
1127
- def test_rubinius_eh
1128
- assert_deprecation do
1129
- assert self.class.rubinius? "rbx"
1130
- end
1131
- assert_deprecation do
1132
- assert self.rubinius? "rbx"
1133
- end
1134
- end
1135
-
1136
- def test_maglev_eh
1137
- assert_deprecation do
1138
- assert self.class.maglev? "maglev"
1139
- end
1140
- assert_deprecation do
1141
- assert self.maglev? "maglev"
1142
- end
1143
- end
1144
-
1145
1095
  def test_osx_eh
1146
1096
  assert self.class.osx? "darwin"
1147
1097
  assert self.osx? "darwin"
@@ -1166,35 +1116,6 @@ class TestMinitestUnitRecording < MetaMetaMetaTestCase
1166
1116
  assert_equal expected, recorded
1167
1117
  end
1168
1118
 
1169
- def test_run_with_bogus_reporter
1170
- # https://github.com/seattlerb/minitest/issues/659
1171
- # TODO: remove test for minitest 6
1172
- @tu = Class.new FakeNamedTest do
1173
- def test_method
1174
- assert true
1175
- end
1176
- end
1177
-
1178
- bogus_reporter = Class.new do # doesn't subclass AbstractReporter
1179
- def start; @success = false; end
1180
- # def prerecord klass, name; end # doesn't define full API
1181
- def record _result; @success = true; end
1182
- def report; end
1183
- def passed?; end
1184
- def results; end
1185
- def success?; @success; end
1186
- end.new
1187
-
1188
- self.reporter = Minitest::CompositeReporter.new
1189
- reporter << bogus_reporter
1190
-
1191
- Minitest::Runnable.runnables.delete @tu
1192
-
1193
- @tu.run reporter, {}
1194
-
1195
- assert_predicate bogus_reporter, :success?
1196
- end
1197
-
1198
1119
  def test_record_passing
1199
1120
  assert_run_record do
1200
1121
  def test_method