minitest 5.11.3 → 5.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +102 -3
- data/Manifest.txt +1 -0
- data/README.rdoc +61 -7
- data/Rakefile +4 -16
- data/lib/minitest/assertions.rb +140 -26
- data/lib/minitest/benchmark.rb +2 -2
- data/lib/minitest/expectations.rb +54 -35
- data/lib/minitest/mock.rb +5 -1
- data/lib/minitest/spec.rb +19 -8
- data/lib/minitest.rb +90 -21
- data/test/minitest/metametameta.rb +42 -8
- data/test/minitest/test_minitest_assertions.rb +1575 -0
- data/test/minitest/test_minitest_mock.rb +14 -4
- data/test/minitest/test_minitest_spec.rb +215 -141
- data/test/minitest/test_minitest_test.rb +38 -1096
- data.tar.gz.sig +0 -0
- metadata +33 -22
- metadata.gz.sig +0 -0
@@ -64,8 +64,6 @@ class TestMinitestMock < Minitest::Test
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_mock_args_does_not_raise
|
67
|
-
skip "non-opaque use of ==" if maglev?
|
68
|
-
|
69
67
|
arg = Minitest::Mock.new
|
70
68
|
mock = Minitest::Mock.new
|
71
69
|
mock.expect(:foo, nil, [arg])
|
@@ -362,7 +360,7 @@ end
|
|
362
360
|
require "minitest/metametameta"
|
363
361
|
|
364
362
|
class TestMinitestStub < Minitest::Test
|
365
|
-
|
363
|
+
# Do not parallelize since we're calling stub on class methods
|
366
364
|
|
367
365
|
def setup
|
368
366
|
super
|
@@ -374,7 +372,7 @@ class TestMinitestStub < Minitest::Test
|
|
374
372
|
|
375
373
|
def teardown
|
376
374
|
super
|
377
|
-
assert_equal @assertion_count, @tc.assertions
|
375
|
+
assert_equal @assertion_count, @tc.assertions if self.passed?
|
378
376
|
end
|
379
377
|
|
380
378
|
class Time
|
@@ -593,6 +591,18 @@ class TestMinitestStub < Minitest::Test
|
|
593
591
|
end
|
594
592
|
end
|
595
593
|
|
594
|
+
class Keywords
|
595
|
+
def self.args req, kw1:, kw2:24
|
596
|
+
[req, kw1, kw2]
|
597
|
+
end
|
598
|
+
end
|
599
|
+
|
600
|
+
def test_stub_callable_keyword_args
|
601
|
+
Keywords.stub :args, ->(*args, **kws) { [args, kws] } do
|
602
|
+
@tc.assert_equal [["woot"], { kw1: 42 }], Keywords.args("woot", kw1: 42)
|
603
|
+
end
|
604
|
+
end
|
605
|
+
|
596
606
|
def test_stub_callable_block_5 # from tenderlove
|
597
607
|
@assertion_count += 1
|
598
608
|
Foo.stub5 :blocking, Bar.new do
|