minitest 5.4.0 → 5.4.1
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.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/README.txt +3 -0
- data/lib/minitest.rb +1 -1
- data/lib/minitest/spec.rb +4 -2
- data/test/minitest/metametameta.rb +10 -0
- data/test/minitest/test_minitest_reporter.rb +1 -33
- data/test/minitest/test_minitest_spec.rb +56 -2
- data/test/minitest/test_minitest_unit.rb +6 -20
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7423e740dff22f01e1867e48e30e6393029dcde6
|
4
|
+
data.tar.gz: c407e0bf946d70ad125e54810d919bf3301826f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16942f3e38beaa47570abeecbeedca6b44c55af0b992b854a886adfc38e0373d9cf2bb30a8181c33a33307858c920de28e3e0e2fbf9b62878484b11d2c994f6a
|
7
|
+
data.tar.gz: c54dd7ef0bc0c64fc696ac3421c24dc376a95fbac0aa49ea3d33026d3dfe7622417da65b9f9a1c930ac7649935011aba5070a7180ccc7ececf4d15fd1ffe196a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -422,6 +422,8 @@ minispec-metadata :: Metadata for describe/it blocks
|
|
422
422
|
minitest-ansi :: Colorize minitest output with ANSI colors.
|
423
423
|
minitest-around :: Around block for minitest. An alternative to
|
424
424
|
setup/teardown dance.
|
425
|
+
minitest-bang :: Adds support for RSpec-style let! to immediately
|
426
|
+
invoke let statements before each test.
|
425
427
|
minitest-capistrano :: Assertions and expectations for testing
|
426
428
|
Capistrano recipes.
|
427
429
|
minitest-capybara :: Capybara matchers support for minitest unit and
|
@@ -487,6 +489,7 @@ minitest-spec-expect :: Expect syntax for Minitest::Spec (e.g.
|
|
487
489
|
minitest-spec-magic :: Minitest::Spec extensions for Rails and beyond.
|
488
490
|
minitest-spec-rails :: Drop in Minitest::Spec superclass for
|
489
491
|
ActiveSupport::TestCase.
|
492
|
+
minitest-stately :: Find leaking state between tests
|
490
493
|
minitest-stub_any_instance :: Stub any instance of a method on the given class
|
491
494
|
for the duration of a block.
|
492
495
|
minitest-stub-const :: Stub constants for the duration of a block.
|
data/lib/minitest.rb
CHANGED
data/lib/minitest/spec.rb
CHANGED
@@ -206,10 +206,12 @@ class Minitest::Spec < Minitest::Test
|
|
206
206
|
|
207
207
|
name = "test_%04d_%s" % [ @specs, desc ]
|
208
208
|
|
209
|
+
undef_klasses = self.children.reject { |c| c.public_method_defined? name }
|
210
|
+
|
209
211
|
define_method name, &block
|
210
212
|
|
211
|
-
|
212
|
-
|
213
|
+
undef_klasses.each do |undef_klass|
|
214
|
+
undef_klass.send :undef_method, name
|
213
215
|
end
|
214
216
|
|
215
217
|
name
|
@@ -59,6 +59,7 @@ class MetaMetaMetaTestCase < Minitest::Test
|
|
59
59
|
|
60
60
|
output.gsub!(/ = \d+.\d\d s = /, ' = 0.00 s = ')
|
61
61
|
output.gsub!(/0x[A-Fa-f0-9]+/, '0xXXX')
|
62
|
+
output.gsub!(/ +$/, '')
|
62
63
|
|
63
64
|
if windows? then
|
64
65
|
output.gsub!(/\[(?:[A-Za-z]:)?[^\]:]+:\d+\]/, '[FILE:LINE]')
|
@@ -71,6 +72,15 @@ class MetaMetaMetaTestCase < Minitest::Test
|
|
71
72
|
output
|
72
73
|
end
|
73
74
|
|
75
|
+
def restore_env
|
76
|
+
old_value = ENV["MT_NO_SKIP_MSG"]
|
77
|
+
ENV.delete "MT_NO_SKIP_MSG"
|
78
|
+
|
79
|
+
yield
|
80
|
+
ensure
|
81
|
+
ENV["MT_NO_SKIP_MSG"] = old_value
|
82
|
+
end
|
83
|
+
|
74
84
|
def setup
|
75
85
|
super
|
76
86
|
srand 42
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "minitest/autorun"
|
2
2
|
require "minitest/metametameta"
|
3
3
|
|
4
|
-
class TestMinitestReporter <
|
4
|
+
class TestMinitestReporter < MetaMetaMetaTestCase
|
5
5
|
|
6
6
|
attr_accessor :r, :io
|
7
7
|
|
@@ -165,25 +165,6 @@ class TestMinitestReporter < Minitest::Test
|
|
165
165
|
assert_equal 0, r.assertions
|
166
166
|
end
|
167
167
|
|
168
|
-
def normalize_output output
|
169
|
-
output.sub!(/Finished in .*/, "Finished in 0.00")
|
170
|
-
output.sub!(/Loaded suite .*/, 'Loaded suite blah')
|
171
|
-
|
172
|
-
output.gsub!(/ = \d+.\d\d s = /, ' = 0.00 s = ')
|
173
|
-
output.gsub!(/0x[A-Fa-f0-9]+/, '0xXXX')
|
174
|
-
output.gsub!(/ +$/, '')
|
175
|
-
|
176
|
-
if windows? then
|
177
|
-
output.gsub!(/\[(?:[A-Za-z]:)?[^\]:]+:\d+\]/, '[FILE:LINE]')
|
178
|
-
output.gsub!(/^(\s+)(?:[A-Za-z]:)?[^:]+:\d+:in/, '\1FILE:LINE:in')
|
179
|
-
else
|
180
|
-
output.gsub!(/\[[^\]:]+:\d+\]/, '[FILE:LINE]')
|
181
|
-
output.gsub!(/^(\s+)[^:]+:\d+:in/, '\1FILE:LINE:in')
|
182
|
-
end
|
183
|
-
|
184
|
-
output
|
185
|
-
end
|
186
|
-
|
187
168
|
def test_report_empty
|
188
169
|
r.start
|
189
170
|
r.report
|
@@ -200,7 +181,6 @@ class TestMinitestReporter < Minitest::Test
|
|
200
181
|
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
|
201
182
|
EOM
|
202
183
|
|
203
|
-
|
204
184
|
assert_equal exp, normalize_output(io.string)
|
205
185
|
end
|
206
186
|
|
@@ -221,7 +201,6 @@ class TestMinitestReporter < Minitest::Test
|
|
221
201
|
1 runs, 0 assertions, 0 failures, 0 errors, 0 skips
|
222
202
|
EOM
|
223
203
|
|
224
|
-
|
225
204
|
assert_equal exp, normalize_output(io.string)
|
226
205
|
end
|
227
206
|
|
@@ -246,7 +225,6 @@ class TestMinitestReporter < Minitest::Test
|
|
246
225
|
1 runs, 0 assertions, 1 failures, 0 errors, 0 skips
|
247
226
|
EOM
|
248
227
|
|
249
|
-
|
250
228
|
assert_equal exp, normalize_output(io.string)
|
251
229
|
end
|
252
230
|
|
@@ -276,16 +254,6 @@ class TestMinitestReporter < Minitest::Test
|
|
276
254
|
assert_equal exp, normalize_output(io.string)
|
277
255
|
end
|
278
256
|
|
279
|
-
def restore_env
|
280
|
-
old_value = ENV["MT_NO_SKIP_MSG"]
|
281
|
-
ENV.delete "MT_NO_SKIP_MSG"
|
282
|
-
|
283
|
-
yield
|
284
|
-
ensure
|
285
|
-
ENV["MT_NO_SKIP_MSG"] = old_value
|
286
|
-
end
|
287
|
-
|
288
|
-
|
289
257
|
def test_report_skipped
|
290
258
|
r.start
|
291
259
|
r.record skip_test
|
@@ -613,6 +613,40 @@ class TestMetaStatic < Minitest::Test
|
|
613
613
|
assert_equal [], y.children
|
614
614
|
assert_equal [], z.children
|
615
615
|
end
|
616
|
+
|
617
|
+
def test_it_wont_remove_existing_child_test_methods
|
618
|
+
Minitest::Spec.children.clear # prevents parallel run
|
619
|
+
|
620
|
+
outer = inner = nil
|
621
|
+
outer = describe "outer" do
|
622
|
+
inner = describe "inner" do
|
623
|
+
it do
|
624
|
+
assert true
|
625
|
+
end
|
626
|
+
end
|
627
|
+
it do
|
628
|
+
assert true
|
629
|
+
end
|
630
|
+
end
|
631
|
+
|
632
|
+
assert_equal 1, outer.public_instance_methods.grep(/^test_/).count
|
633
|
+
assert_equal 1, inner.public_instance_methods.grep(/^test_/).count
|
634
|
+
end
|
635
|
+
|
636
|
+
def test_it_wont_add_test_methods_to_children
|
637
|
+
Minitest::Spec.children.clear # prevents parallel run
|
638
|
+
|
639
|
+
outer = inner = nil
|
640
|
+
outer = describe "outer" do
|
641
|
+
inner = describe "inner" do end
|
642
|
+
it do
|
643
|
+
assert true
|
644
|
+
end
|
645
|
+
end
|
646
|
+
|
647
|
+
assert_equal 1, outer.public_instance_methods.grep(/^test_/).count
|
648
|
+
assert_equal 0, inner.public_instance_methods.grep(/^test_/).count
|
649
|
+
end
|
616
650
|
end
|
617
651
|
|
618
652
|
require "minitest/metametameta"
|
@@ -746,6 +780,24 @@ class TestMeta < MetaMetaMetaTestCase
|
|
746
780
|
assert_equal inner_methods2, z.instance_methods(false).sort.map(&:to_s)
|
747
781
|
end
|
748
782
|
|
783
|
+
def test_structure_postfix_it
|
784
|
+
z = nil
|
785
|
+
y = describe "outer" do
|
786
|
+
# NOT here, below the inner-describe!
|
787
|
+
# it "inner-it" do end
|
788
|
+
|
789
|
+
z = describe "inner" do
|
790
|
+
it "inner-it" do end
|
791
|
+
end
|
792
|
+
|
793
|
+
# defined AFTER inner describe means we'll try to wipe out the inner-it
|
794
|
+
it "inner-it" do end
|
795
|
+
end
|
796
|
+
|
797
|
+
assert_equal %w(test_0001_inner-it), y.instance_methods(false).map(&:to_s)
|
798
|
+
assert_equal %w(test_0001_inner-it), z.instance_methods(false).map(&:to_s)
|
799
|
+
end
|
800
|
+
|
749
801
|
def test_setup_teardown_behavior
|
750
802
|
_, _, z, before_list, after_list = util_structure
|
751
803
|
|
@@ -764,12 +816,14 @@ class TestMeta < MetaMetaMetaTestCase
|
|
764
816
|
y = describe "first thingy" do end
|
765
817
|
|
766
818
|
x1 = it "top level it" do end
|
767
|
-
x2 = it "не латинские
|
819
|
+
x2 = it "не латинские &いった α, β, γ, δ, ε hello!!! world" do end
|
768
820
|
|
769
821
|
z = describe "second thingy" do end
|
770
822
|
end
|
771
823
|
|
772
|
-
test_methods = ["test_0001_top level it",
|
824
|
+
test_methods = ["test_0001_top level it",
|
825
|
+
"test_0002_не латинские &いった α, β, γ, δ, ε hello!!! world"
|
826
|
+
].sort
|
773
827
|
|
774
828
|
assert_equal test_methods, [x1, x2]
|
775
829
|
assert_equal test_methods,
|
@@ -239,16 +239,7 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
239
239
|
end
|
240
240
|
|
241
241
|
def test_run_failing
|
242
|
-
|
243
|
-
Class.new Minitest::Test do
|
244
|
-
def test_something
|
245
|
-
assert true
|
246
|
-
end
|
247
|
-
|
248
|
-
def test_failure
|
249
|
-
assert false
|
250
|
-
end
|
251
|
-
end
|
242
|
+
setup_basic_tu
|
252
243
|
|
253
244
|
expected = clean <<-EOM
|
254
245
|
F.
|
@@ -265,7 +256,7 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
265
256
|
assert_report expected
|
266
257
|
end
|
267
258
|
|
268
|
-
def
|
259
|
+
def setup_basic_tu
|
269
260
|
@tu =
|
270
261
|
Class.new Minitest::Test do
|
271
262
|
def test_something
|
@@ -276,6 +267,10 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
276
267
|
assert false
|
277
268
|
end
|
278
269
|
end
|
270
|
+
end
|
271
|
+
|
272
|
+
def test_run_failing_filtered
|
273
|
+
setup_basic_tu
|
279
274
|
|
280
275
|
expected = clean <<-EOM
|
281
276
|
.
|
@@ -368,15 +363,6 @@ class TestMinitestRunner < MetaMetaMetaTestCase
|
|
368
363
|
assert_report expected
|
369
364
|
end
|
370
365
|
|
371
|
-
def restore_env
|
372
|
-
old_value = ENV["MT_NO_SKIP_MSG"]
|
373
|
-
ENV.delete "MT_NO_SKIP_MSG"
|
374
|
-
|
375
|
-
yield
|
376
|
-
ensure
|
377
|
-
ENV["MT_NO_SKIP_MSG"] = old_value
|
378
|
-
end
|
379
|
-
|
380
366
|
def test_run_skip
|
381
367
|
@tu =
|
382
368
|
Class.new Minitest::Test do
|
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.4.
|
4
|
+
version: 5.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw
|
30
30
|
xx3n58i0lQkBE1EpKE0lFu/y
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2014-
|
32
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
metadata.gz.sig
CHANGED
Binary file
|