minitest 4.3.2 → 4.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/README.txt +12 -2
- data/lib/minitest/mock.rb +2 -1
- data/lib/minitest/unit.rb +1 -1
- data/test/minitest/test_minitest_unit.rb +23 -20
- metadata +4 -4
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -221,6 +221,14 @@ Output is tab-delimited to make it easy to paste into a spreadsheet.
|
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
224
|
+
A note on stubbing: In order to stub a method, the method must
|
225
|
+
actually exist prior to stubbing. Use a singleton method to create a
|
226
|
+
new non-existing method:
|
227
|
+
|
228
|
+
def obj_under_test.fake_method
|
229
|
+
...
|
230
|
+
end
|
231
|
+
|
224
232
|
=== Customizable Test Runner Types:
|
225
233
|
|
226
234
|
MiniTest::Unit.runner=(runner) provides an easy way of creating custom
|
@@ -275,6 +283,10 @@ fixture loading:
|
|
275
283
|
|
276
284
|
== Known Extensions:
|
277
285
|
|
286
|
+
capybara_minitest_spec :: Bridge between Capybara RSpec matchers and MiniTest::Spec expectations (e.g. page.must_have_content('Title')).
|
287
|
+
minispec-metadata :: Metadata for describe/it blocks
|
288
|
+
(e.g. `it 'requires JS driver', js: true do`)
|
289
|
+
minitest-around :: Around block for minitest. An alternative to setup/teardown dance.
|
278
290
|
minitest-capistrano :: Assertions and expectations for testing Capistrano recipes
|
279
291
|
minitest-capybara :: Capybara matchers support for minitest unit and spec
|
280
292
|
minitest-chef-handler :: Run Minitest suites as Chef report handlers
|
@@ -320,7 +332,6 @@ pry-rescue :: A pry plugin w/ minitest support. See pry-rescue/mini
|
|
320
332
|
Authors... Please send me a pull request with a description of your minitest extension.
|
321
333
|
|
322
334
|
* assay-minitest
|
323
|
-
* capybara_minitest_spec
|
324
335
|
* detroit-minitest
|
325
336
|
* em-minitest-spec
|
326
337
|
* flexmock-minitest
|
@@ -328,7 +339,6 @@ Authors... Please send me a pull request with a description of your minitest ext
|
|
328
339
|
* guard-minitest-decisiv
|
329
340
|
* minitest-activemodel
|
330
341
|
* minitest-ar-assertions
|
331
|
-
* minitest-around
|
332
342
|
* minitest-capybara-unit
|
333
343
|
* minitest-colorer
|
334
344
|
* minitest-deluxe
|
data/lib/minitest/mock.rb
CHANGED
@@ -152,7 +152,8 @@ class Object # :nodoc:
|
|
152
152
|
# Add a temporary stubbed method replacing +name+ for the duration
|
153
153
|
# of the +block+. If +val_or_callable+ responds to #call, then it
|
154
154
|
# returns the result of calling it, otherwise returns the value
|
155
|
-
# as-is. Cleans up the stub at the end of the +block+.
|
155
|
+
# as-is. Cleans up the stub at the end of the +block+. The method
|
156
|
+
# +name+ must exist before stubbing.
|
156
157
|
#
|
157
158
|
# def test_stale_eh
|
158
159
|
# obj_under_test = Something.new
|
data/lib/minitest/unit.rb
CHANGED
@@ -677,6 +677,15 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
677
677
|
"expected #{@assertion_count} assertions to be fired during the test, not #{@tc._assertions}") if @tc._assertions
|
678
678
|
end
|
679
679
|
|
680
|
+
def non_verbose
|
681
|
+
orig_verbose = $VERBOSE
|
682
|
+
$VERBOSE = false
|
683
|
+
|
684
|
+
yield
|
685
|
+
ensure
|
686
|
+
$VERBOSE = orig_verbose
|
687
|
+
end
|
688
|
+
|
680
689
|
def test_assert
|
681
690
|
@assertion_count = 2
|
682
691
|
|
@@ -1307,36 +1316,30 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
1307
1316
|
def test_capture_io
|
1308
1317
|
@assertion_count = 0
|
1309
1318
|
|
1310
|
-
|
1311
|
-
|
1319
|
+
non_verbose do
|
1320
|
+
out, err = capture_io do
|
1321
|
+
puts 'hi'
|
1322
|
+
warn 'bye!'
|
1323
|
+
end
|
1312
1324
|
|
1313
|
-
|
1314
|
-
|
1315
|
-
warn 'bye!'
|
1325
|
+
assert_equal "hi\n", out
|
1326
|
+
assert_equal "bye!\n", err
|
1316
1327
|
end
|
1317
|
-
|
1318
|
-
assert_equal "hi\n", out
|
1319
|
-
assert_equal "bye!\n", err
|
1320
|
-
ensure
|
1321
|
-
$VERBOSE = orig_verbose
|
1322
1328
|
end
|
1323
1329
|
|
1324
1330
|
def test_capture_subprocess_io
|
1325
1331
|
@assertion_count = 0
|
1326
1332
|
skip "Dunno why but the parallel run of this fails"
|
1327
1333
|
|
1328
|
-
|
1329
|
-
|
1334
|
+
non_verbose do
|
1335
|
+
out, err = capture_subprocess_io do
|
1336
|
+
system("echo 'hi'")
|
1337
|
+
system("echo 'bye!' 1>&2")
|
1338
|
+
end
|
1330
1339
|
|
1331
|
-
|
1332
|
-
|
1333
|
-
system("echo 'bye!' 1>&2")
|
1340
|
+
assert_equal "hi\n", out
|
1341
|
+
assert_equal "bye!\n", err
|
1334
1342
|
end
|
1335
|
-
|
1336
|
-
assert_equal "hi\n", out
|
1337
|
-
assert_equal "bye!\n", err
|
1338
|
-
ensure
|
1339
|
-
$VERBOSE = orig_verbose
|
1340
1343
|
end
|
1341
1344
|
|
1342
1345
|
def test_class_asserts_match_refutes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 4
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 4.3.
|
9
|
+
- 3
|
10
|
+
version: 4.3.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2012-
|
39
|
+
date: 2012-12-07 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
metadata.gz.sig
CHANGED
Binary file
|