minitest 5.10.2 → 5.10.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -2
- data/History.rdoc +11 -0
- data/README.rdoc +72 -2
- data/lib/minitest.rb +17 -8
- data/lib/minitest/mock.rb +11 -0
- data/lib/minitest/parallel.rb +1 -0
- 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: 32d4df1397bf8fc366b4b18555936d7c92853121
|
4
|
+
data.tar.gz: 4000474506d5056f3117b1a93e1bc4019dfd15af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 195277b6093c3650634809f445c274d8df6bfafb4f32be448f4cdde07de9edf47c64e4f05cdf3572bf79f61e2597ce33c2b7821cd147d4c8bd2f251451e86098
|
7
|
+
data.tar.gz: a8a16930df76274303310ba4faf115914913bea38b559ec4edfad8ae2a835fb22e7d6308c88eadf93044ea422b334d65e33c8c59f15f0ece27a962b1fc8d7e9c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
V���%s�g�e�Q�K�͝P�u�I}����I6I}Kj��ڳt�8a"w��TFig�"��(��Hڞ�Ӱ�V�ص^����Z=�j�=���'����-���i*-u�/�d���1�z��/��X�E8a��� ��z֍?!�$�:�uwR"b��C��3L���j��Tk��!�Y6������n^/w�o@J
|
2
|
+
/���-�*�^~)Z�Y'��,5��vCM 1��B�����N�y�8
|
data/History.rdoc
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
=== 5.10.3 / 2017-07-21
|
2
|
+
|
3
|
+
* 1 minor enhancement:
|
4
|
+
|
5
|
+
* Extended documentation for Mock#expect for multiple calls to mock object. (insti)
|
6
|
+
|
7
|
+
* 2 bug fixes:
|
8
|
+
|
9
|
+
* Finished off missing doco.
|
10
|
+
* Fixed verbose output on parallelize_me! classes. (chanks)
|
11
|
+
|
1
12
|
=== 5.10.2 / 2017-05-09
|
2
13
|
|
3
14
|
* 1 minor enhancement:
|
data/README.rdoc
CHANGED
@@ -139,8 +139,8 @@ Define your tests as methods beginning with +test_+.
|
|
139
139
|
|
140
140
|
For matchers support check out:
|
141
141
|
|
142
|
-
https://github.com/wojtekmach/minitest-matchers
|
143
|
-
https://github.com/rmm5t/minitest-matchers_vaccine
|
142
|
+
* https://github.com/wojtekmach/minitest-matchers
|
143
|
+
* https://github.com/rmm5t/minitest-matchers_vaccine
|
144
144
|
|
145
145
|
=== Benchmarks
|
146
146
|
|
@@ -452,6 +452,75 @@ able to require minitest and run your tests.
|
|
452
452
|
* rdoc
|
453
453
|
* ...and of course, everything from seattle.rb...
|
454
454
|
|
455
|
+
== Developing Minitest:
|
456
|
+
|
457
|
+
=== Minitest's own tests require UTF-8 external encoding.
|
458
|
+
|
459
|
+
This is a common problem in Windows, where the default external Encoding is
|
460
|
+
often CP850, but can affect any platform.
|
461
|
+
Minitest can run test suites using any Encoding, but to run Minitest's
|
462
|
+
own tests you must have a default external Encoding of UTF-8.
|
463
|
+
|
464
|
+
If your encoding is wrong, you'll see errors like:
|
465
|
+
|
466
|
+
--- expected
|
467
|
+
+++ actual
|
468
|
+
@@ -1,2 +1,3 @@
|
469
|
+
# encoding: UTF-8
|
470
|
+
-"Expected /\\w+/ to not match \"blah blah blah\"."
|
471
|
+
+"Expected /\\w+/ to not match # encoding: UTF-8
|
472
|
+
+\"blah blah blah\"."
|
473
|
+
|
474
|
+
To check your current encoding, run:
|
475
|
+
|
476
|
+
ruby -e 'puts Encoding.default_external'
|
477
|
+
|
478
|
+
If your output is something other than UTF-8, you can set the RUBYOPTS
|
479
|
+
env variable to a value of '-Eutf-8'. Something like:
|
480
|
+
|
481
|
+
RUBYOPT='-Eutf-8' ruby -e 'puts Encoding.default_external'
|
482
|
+
|
483
|
+
Check your OS/shell documentation for the precise syntax (the above
|
484
|
+
will not work on a basic Windows CMD prompt, look for the SET command).
|
485
|
+
Once you've got it successfully outputing UTF-8, use the same setting
|
486
|
+
when running rake in Minitest.
|
487
|
+
|
488
|
+
=== Minitest's own tests require GNU (or similar) diff.
|
489
|
+
|
490
|
+
This is also a problem primarily affecting Windows developers. PowerShell
|
491
|
+
has a command called diff, but it is not suitable for use with Minitest.
|
492
|
+
|
493
|
+
If you see failures like either of these, you are probably missing diff tool:
|
494
|
+
|
495
|
+
4) Failure:
|
496
|
+
TestMinitestUnitTestCase#test_assert_equal_different_long [D:/ruby/seattlerb/minitest/test/minitest/test_minitest_test.rb:936]:
|
497
|
+
Expected: "--- expected\n+++ actual\n@@ -1 +1 @@\n-\"hahahahahahahahahahahahahahahahahahahaha\"\n+\"blahblahblahblahblahblahblahblahblahblah\"\n"
|
498
|
+
Actual: "Expected: \"hahahahahahahahahahahahahahahahahahahaha\"\n Actual: \"blahblahblahblahblahblahblahblahblahblah\""
|
499
|
+
|
500
|
+
|
501
|
+
5) Failure:
|
502
|
+
TestMinitestUnitTestCase#test_assert_equal_different_collection_hash_hex_invisible [D:/ruby/seattlerb/minitest/test/minitest/test_minitest_test.rb:845]:
|
503
|
+
Expected: "No visible difference in the Hash#inspect output.\nYou should look at the implementation of #== on Hash or its members.\n
|
504
|
+
{1=>#<Object:0xXXXXXX>}"
|
505
|
+
Actual: "Expected: {1=>#<Object:0x00000003ba0470>}\n Actual: {1=>#<Object:0x00000003ba0448>}"
|
506
|
+
|
507
|
+
|
508
|
+
If you use Cygwin or MSYS2 or similar there are packages that include a
|
509
|
+
GNU diff for Widnows. If you don't, you can download GNU diffutils from
|
510
|
+
http://gnuwin32.sourceforge.net/packages/diffutils.htm
|
511
|
+
(make sure to add it to your PATH).
|
512
|
+
|
513
|
+
You can make sure it's installed and path is configured properly with:
|
514
|
+
|
515
|
+
diff.exe -v
|
516
|
+
|
517
|
+
There are multiple lines of output, the first should be something like:
|
518
|
+
|
519
|
+
diff (GNU diffutils) 2.8.1
|
520
|
+
|
521
|
+
If you are using PowerShell make sure you run diff.exe, not just diff,
|
522
|
+
which will invoke the PowerShell built in function.
|
523
|
+
|
455
524
|
== Known Extensions:
|
456
525
|
|
457
526
|
capybara_minitest_spec :: Bridge between Capybara RSpec matchers and
|
@@ -462,6 +531,7 @@ color_pound_spec_reporter :: Test names print Ruby Object types in color with
|
|
462
531
|
minispec-metadata :: Metadata for describe/it blocks & CLI tag filter.
|
463
532
|
E.g. <tt>it "requires JS driver", js: true do</tt> &
|
464
533
|
<tt>ruby test.rb --tag js</tt> runs tests tagged :js.
|
534
|
+
minispec-rails :: Minimal support to use Spec style in Rails 5+.
|
465
535
|
minitest-around :: Around block for minitest. An alternative to
|
466
536
|
setup/teardown dance.
|
467
537
|
minitest-assert_errors :: Adds Minitest assertions to test for errors raised
|
data/lib/minitest.rb
CHANGED
@@ -8,7 +8,7 @@ require "stringio"
|
|
8
8
|
# :include: README.rdoc
|
9
9
|
|
10
10
|
module Minitest
|
11
|
-
VERSION = "5.10.
|
11
|
+
VERSION = "5.10.3" # :nodoc:
|
12
12
|
ENCS = "".respond_to? :encoding # :nodoc:
|
13
13
|
|
14
14
|
@@installed_at_exit ||= false
|
@@ -486,7 +486,7 @@ module Minitest
|
|
486
486
|
# own.
|
487
487
|
|
488
488
|
class ProgressReporter < Reporter
|
489
|
-
def prerecord klass, name
|
489
|
+
def prerecord klass, name #:nodoc:
|
490
490
|
if options[:verbose] then
|
491
491
|
io.print "%s#%s = " % [klass, name]
|
492
492
|
io.flush
|
@@ -614,7 +614,7 @@ module Minitest
|
|
614
614
|
io
|
615
615
|
end
|
616
616
|
|
617
|
-
def to_s
|
617
|
+
def to_s # :nodoc:
|
618
618
|
aggregated_results(StringIO.new(binary_string)).string
|
619
619
|
end
|
620
620
|
|
@@ -808,16 +808,25 @@ module Minitest
|
|
808
808
|
end
|
809
809
|
end
|
810
810
|
|
811
|
-
|
811
|
+
##
|
812
|
+
# The standard backtrace filter for minitest.
|
813
|
+
#
|
814
|
+
# See Minitest.backtrace_filter=.
|
815
|
+
|
816
|
+
class BacktraceFilter
|
817
|
+
|
818
|
+
MT_RE = %r%lib/minitest% #:nodoc:
|
819
|
+
|
820
|
+
##
|
821
|
+
# Filter +bt+ to something useful. Returns the whole thing if $DEBUG.
|
822
|
+
|
812
823
|
def filter bt
|
813
824
|
return ["No backtrace"] unless bt
|
814
825
|
|
815
826
|
return bt.dup if $DEBUG
|
816
827
|
|
817
|
-
|
818
|
-
|
819
|
-
new_bt = bt.take_while { |line| line !~ mt_re }
|
820
|
-
new_bt = bt.select { |line| line !~ mt_re } if new_bt.empty?
|
828
|
+
new_bt = bt.take_while { |line| line !~ MT_RE }
|
829
|
+
new_bt = bt.select { |line| line !~ MT_RE } if new_bt.empty?
|
821
830
|
new_bt = bt.dup if new_bt.empty?
|
822
831
|
|
823
832
|
new_bt
|
data/lib/minitest/mock.rb
CHANGED
@@ -66,6 +66,17 @@ module Minitest # :nodoc:
|
|
66
66
|
#
|
67
67
|
# @mock.expect(:uses_one_string, true, ["foo"])
|
68
68
|
# @mock.uses_one_string("bar") # => raises MockExpectationError
|
69
|
+
#
|
70
|
+
# If a method will be called multiple times, specify a new expect for each one.
|
71
|
+
# They will be used in the order you define them.
|
72
|
+
#
|
73
|
+
# @mock.expect(:ordinal_increment, 'first')
|
74
|
+
# @mock.expect(:ordinal_increment, 'second')
|
75
|
+
#
|
76
|
+
# @mock.ordinal_increment # => 'first'
|
77
|
+
# @mock.ordinal_increment # => 'second'
|
78
|
+
# @mock.ordinal_increment # => raises MockExpectationError "No more expects available for :ordinal_increment"
|
79
|
+
#
|
69
80
|
|
70
81
|
def expect name, retval, args = [], &blk
|
71
82
|
name = name.to_sym
|
data/lib/minitest/parallel.rb
CHANGED
@@ -29,6 +29,7 @@ module Minitest
|
|
29
29
|
Thread.current.abort_on_exception = true
|
30
30
|
while (job = queue.pop)
|
31
31
|
klass, method, reporter = job
|
32
|
+
reporter.synchronize { reporter.prerecord klass, method }
|
32
33
|
result = Minitest.run_one_method klass, method
|
33
34
|
reporter.synchronize { reporter.record result }
|
34
35
|
end
|
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.10.
|
4
|
+
version: 5.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
E4oJcnPkJAr0rw504JGtlZtONZQblwmRJOIdXzolaE3NRGUzGVOUSptZppAKiavY
|
31
31
|
fO6tdKQc/5RfA8oQEkg8hrxA5PQSz4TOFJGLpFvIapEk6tMruQ0bHgkhr9auXg==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2017-
|
33
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rdoc
|
metadata.gz.sig
CHANGED
Binary file
|