minitest 5.10.1 → 5.10.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 351bcef5cdca59a8a7698e72b0416aef86219192
4
- data.tar.gz: 7710a72ed204d63809ae8f9dae5f0f88c0747dbe
3
+ metadata.gz: a068763ee667d9319f37090fc6dca04537d7bd28
4
+ data.tar.gz: 7bc8c8f4d5b7107276ca308ef8a60a70078b4b18
5
5
  SHA512:
6
- metadata.gz: 4b72cb4785010a33c2865225f9e07bb586ead20c47da1c83d735734766c3029a18e85ea46b691489e0a7310bd36ffc6c67f16eec57c94128311cbb156919fde8
7
- data.tar.gz: ce094ff893bfacd8afdff1b390c32799d95da6159f7e4f71c3d9665a5c0dbf629c36d23157e8940b779a51c18d9a0e50a832097c635b5bacfd9ee9d0879ad4ad
6
+ metadata.gz: eb2c6d2f22a6d3a4bd32f600494173714705d6941de1a7c3abb449bbd7e404ddf7a9b4b2bde463f52e24cf9e253c9d68ea729468c9b049dfcc9b52c4344bea28
7
+ data.tar.gz: f1d4e1a88113f44c4008f608c69f457c405483fd19c16e8a5851db57734f9331500694a27b75193eb2812811bead231c3689df7242cd6b81ad6bd3c9630ab578
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- �(�HR��O���:��ȡ�.ݎ
2
- /�&gR>�Q���`C&G���bI������(ۧ�M��L2�a�Qx�����;^ӯ���W���K��8U��|��~���
1
+ #<@c ��·�\
2
+ %�����ֳ��C�#���� .�Y�ܫA����g���q~���K�@/�t9��Ǥ�l[�̿zB�M����c@��t؜<���d�!�-u�p+(��4���� Z���Z���D�wIs�T�#�s��S�M@� C���"��o�l��]o�~��Ğ�LNV��u�ϓ�I.O�����c���j�BJ�a�Ev���S���K�g�,1&�E)���U1�7)/���Z���t��'��F��
@@ -1,3 +1,19 @@
1
+ === 5.10.2 / 2017-05-09
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added suggestion in minitest/hell to install minitest/proveit.
6
+
7
+ * 7 bug fixes:
8
+
9
+ * Expand MT6 to Minitest 6. (xaviershay)
10
+ * Fixed location of assert_send deprecation. (rab)
11
+ * Fixed location of nil assert_equal deprecation to work with expectations. (jeremyevans)
12
+ * Fixed minitest/hell to use parallelize_me! (azul)
13
+ * Made deprecation use warn so -W0 will silence it.
14
+ * Workaround for rdoc nodoc generation bug that totally f'd up minitest doco. (Paxa)
15
+ * Write aggregated_results directly to the IO object to avoid mixed encoding errors. (tenderlove)
16
+
1
17
  === 5.10.1 / 2016-12-01
2
18
 
3
19
  * 1 bug fix:
@@ -6,13 +22,20 @@
6
22
 
7
23
  === 5.10.0 / 2016-11-30
8
24
 
9
- * 2 minor enhancements:
25
+ * 1 major enhancement:
26
+
27
+ * Deprecated ruby 1.8, 1.9, possibly 2.0, assert_send, & old MiniTest namespace.
28
+
29
+ * 3 minor enhancements:
10
30
 
31
+ * Warn if assert_equal expects a nil. This will fail in minitest 6+. (tenderlove)
11
32
  * Added AbstractReporter#prerecord and extended ProgressReporter and CompositeReporter to use it.
12
33
  * Minor optimization: remove runnables with no runnable methods before run.
13
34
 
14
- * 1 bug fix:
35
+ * 3 bug fixes:
15
36
 
37
+ * Fix assert_throw rescuing any NameError and ArgumentError. (waldyr)
38
+ * Clean up (most of the) last remaining vestiges of minitest/unit.
16
39
  * 2.4: removed deprecation warnings when referring to Fixnum.
17
40
 
18
41
  === 5.9.1 / 2016-09-25
@@ -285,9 +285,9 @@ provided via plugins. To see them, simply run with +--help+:
285
285
  % ruby -Ilib:test test/minitest/test_minitest_test.rb --help
286
286
  minitest options:
287
287
  -h, --help Display this help.
288
- -s, --seed SEED Sets random seed
288
+ -s, --seed SEED Sets random seed. Also via env. Eg: SEED=n rake
289
289
  -v, --verbose Verbose. Show progress processing files.
290
- -n, --name PATTERN Filter run on /pattern/ or string.
290
+ -n, --name PATTERN Filter run on /regexp/ or string.
291
291
  -e, --exclude PATTERN Exclude /regexp/ or string from run.
292
292
 
293
293
  Known extensions: pride, autotest
@@ -2,12 +2,13 @@ require "optparse"
2
2
  require "thread"
3
3
  require "mutex_m"
4
4
  require "minitest/parallel"
5
+ require "stringio"
5
6
 
6
7
  ##
7
8
  # :include: README.rdoc
8
9
 
9
10
  module Minitest
10
- VERSION = "5.10.1" # :nodoc:
11
+ VERSION = "5.10.2" # :nodoc:
11
12
  ENCS = "".respond_to? :encoding # :nodoc:
12
13
 
13
14
  @@installed_at_exit ||= false
@@ -593,7 +594,7 @@ module Minitest
593
594
  io.puts unless options[:verbose] # finish the dots
594
595
  io.puts
595
596
  io.puts statistics
596
- io.puts aggregated_results
597
+ aggregated_results io
597
598
  io.puts summary
598
599
  end
599
600
 
@@ -602,21 +603,20 @@ module Minitest
602
603
  [total_time, count / total_time, assertions / total_time]
603
604
  end
604
605
 
605
- def aggregated_results # :nodoc:
606
+ def aggregated_results io # :nodoc:
606
607
  filtered_results = results.dup
607
608
  filtered_results.reject!(&:skipped?) unless options[:verbose]
608
609
 
609
- s = filtered_results.each_with_index.map { |result, i|
610
- "\n%3d) %s" % [i+1, result]
611
- }.join("\n") + "\n"
612
-
613
- s.force_encoding(io.external_encoding) if
614
- ENCS and io.external_encoding and s.encoding != io.external_encoding
615
-
616
- s
610
+ filtered_results.each_with_index { |result, i|
611
+ io.puts "\n%3d) %s" % [i+1, result]
612
+ }
613
+ io.puts
614
+ io
617
615
  end
618
616
 
619
- alias to_s aggregated_results
617
+ def to_s
618
+ aggregated_results(StringIO.new(binary_string)).string
619
+ end
620
620
 
621
621
  def summary # :nodoc:
622
622
  extra = ""
@@ -627,6 +627,14 @@ module Minitest
627
627
  "%d runs, %d assertions, %d failures, %d errors, %d skips%s" %
628
628
  [count, assertions, failures, errors, skips, extra]
629
629
  end
630
+
631
+ private
632
+
633
+ if '<3'.respond_to? :b
634
+ def binary_string; ''.b; end
635
+ else
636
+ def binary_string; ''.force_encoding(Encoding::ASCII_8BIT); end
637
+ end
630
638
  end
631
639
 
632
640
  ##
@@ -177,7 +177,10 @@ module Minitest
177
177
  if Minitest::VERSION =~ /^6/ then
178
178
  refute_nil exp, "Use assert_nil if expecting nil."
179
179
  else
180
- $stderr.puts "Use assert_nil if expecting nil from #{caller.first}. This will fail in MT6."
180
+ where = Minitest.filter_backtrace(caller).first
181
+ where = where.split(/:in /, 2).first # clean up noise
182
+
183
+ warn "DEPRECATED: Use assert_nil if expecting nil from #{where}. This will fail in Minitest 6."
181
184
  end
182
185
  end
183
186
 
@@ -367,7 +370,9 @@ module Minitest
367
370
  # Fails unless the call returns a true value
368
371
 
369
372
  def assert_send send_ary, m = nil
370
- warn "DEPRECATED: assert_send. From #{caller.first}"
373
+ where = Minitest.filter_backtrace(caller).first
374
+ where = where.split(/:in /, 2).first # clean up noise
375
+ warn "DEPRECATED: assert_send. From #{where}"
371
376
 
372
377
  recv, msg, *args = send_ary
373
378
  m = message(m) {
@@ -1,17 +1,11 @@
1
1
  require "minitest/parallel"
2
2
 
3
3
  class Minitest::Test
4
- class << self
5
- alias :old_test_order :test_order # :nodoc:
6
-
7
- def test_order # :nodoc:
8
- :parallel
9
- end
10
- end
4
+ parallelize_me!
11
5
  end
12
6
 
13
7
  begin
14
8
  require "minitest/proveit"
15
9
  rescue LoadError
16
- # do nothing
10
+ warn "NOTE: `gem install minitest-proveit` for even more hellish tests"
17
11
  end
@@ -13,8 +13,10 @@ module Minitest
13
13
 
14
14
  PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, SystemExit] # :nodoc:
15
15
 
16
- class << self; attr_accessor :io_lock; end # :nodoc:
16
+ # :stopdoc:
17
+ class << self; attr_accessor :io_lock; end
17
18
  self.io_lock = Mutex.new
19
+ # :startdoc:
18
20
 
19
21
  ##
20
22
  # Call this at the top of your tests when you absolutely
@@ -25,7 +25,7 @@ class MetaMetaMetaTestCase < Minitest::Test
25
25
  def run_tu_with_fresh_reporter flags = %w[--seed 42]
26
26
  options = Minitest.process_args flags
27
27
 
28
- @output = StringIO.new("")
28
+ @output = StringIO.new("".encode('UTF-8'))
29
29
 
30
30
  self.reporter = Minitest::CompositeReporter.new
31
31
  reporter << Minitest::SummaryReporter.new(@output, options)
@@ -74,6 +74,12 @@ class TestMinitestReporter < MetaMetaMetaTestCase
74
74
  @st
75
75
  end
76
76
 
77
+ def test_to_s
78
+ r.record passing_test
79
+ r.record fail_test
80
+ assert_match "woot", r.first.to_s
81
+ end
82
+
77
83
  def test_passed_eh_empty
78
84
  assert r.passed?
79
85
  end
@@ -216,6 +216,21 @@ describe Minitest::Spec do
216
216
  end
217
217
  end
218
218
 
219
+ it "needs to warn on equality with nil" do
220
+ @assertion_count += 1 # extra test
221
+
222
+ out, err = capture_io do
223
+ nil.must_equal(nil).must_equal true
224
+ end
225
+
226
+ exp = "DEPRECATED: Use assert_nil if expecting nil from #{__FILE__}:#{__LINE__-3}. " \
227
+ "This will fail in Minitest 6.\n"
228
+ exp = "" if $-w.nil?
229
+
230
+ assert_empty out
231
+ assert_equal exp, err
232
+ end
233
+
219
234
  it "needs to verify floats outside a delta" do
220
235
  @assertion_count += 1 # extra test
221
236
 
@@ -3,6 +3,18 @@
3
3
  require "pathname"
4
4
  require "minitest/metametameta"
5
5
 
6
+ if defined? Encoding then
7
+ e = Encoding.default_external
8
+ if e != Encoding::UTF_8 then
9
+ warn ""
10
+ warn ""
11
+ warn "NOTE: External encoding #{e} is not UTF-8. Tests WILL fail."
12
+ warn " Run tests with `RUBYOPT=-Eutf-8 rake` to avoid errors."
13
+ warn ""
14
+ warn ""
15
+ end
16
+ end
17
+
6
18
  module MyModule; end
7
19
  class AnError < StandardError; include MyModule; end
8
20
  class ImmutableString < String; def inspect; super.freeze; end; end
@@ -66,6 +78,38 @@ class TestMinitestUnit < MetaMetaMetaTestCase
66
78
  # assert_instance_of Minitest::Unit, Minitest::Unit.runner
67
79
  # end
68
80
 
81
+ def test_infectious_binary_encoding
82
+ @tu = Class.new Minitest::Test do
83
+ def test_this_is_not_ascii_assertion
84
+ assert_equal "ЁЁЁ", "ёёё"
85
+ end
86
+
87
+ def test_this_is_non_ascii_failure_message
88
+ fail 'ЁЁЁ'.force_encoding('ASCII-8BIT')
89
+ end
90
+ end
91
+
92
+ expected = clean <<-EOM
93
+ EF
94
+
95
+ Finished in 0.00
96
+
97
+ 1) Error:
98
+ #<Class:0xXXX>#test_this_is_non_ascii_failure_message:
99
+ RuntimeError: ЁЁЁ
100
+ FILE:LINE:in `test_this_is_non_ascii_failure_message'
101
+
102
+ 2) Failure:
103
+ #<Class:0xXXX>#test_this_is_not_ascii_assertion [FILE:LINE]:
104
+ Expected: \"ЁЁЁ\"
105
+ Actual: \"ёёё\"
106
+
107
+ 2 runs, 1 assertions, 1 failures, 1 errors, 0 skips
108
+ EOM
109
+
110
+ assert_report expected
111
+ end
112
+
69
113
  def test_passed_eh_teardown_good
70
114
  test_class = Class.new FakeNamedTest do
71
115
  def teardown; assert true; end
@@ -989,6 +1033,7 @@ class TestMinitestUnitTestCase < Minitest::Test
989
1033
  end
990
1034
  else
991
1035
  err_re = /Use assert_nil if expecting nil from .*test_minitest_test.rb/
1036
+ err_re = "" if $-w.nil?
992
1037
 
993
1038
  assert_output "", err_re do
994
1039
  @tc.assert_equal nil, nil
@@ -1448,7 +1493,9 @@ class TestMinitestUnitTestCase < Minitest::Test
1448
1493
  end
1449
1494
 
1450
1495
  def assert_deprecated name
1451
- dep = /DEPRECATED: #{name}. From #{__FILE__}:\d+:.*?/
1496
+ dep = /DEPRECATED: #{name}. From #{__FILE__}:\d+(?::.*)?/
1497
+ dep = "" if $-w.nil?
1498
+
1452
1499
  assert_output nil, dep do
1453
1500
  yield
1454
1501
  end
@@ -1957,19 +2004,24 @@ class TestMinitestUnitRecording < MetaMetaMetaTestCase
1957
2004
  end
1958
2005
  end
1959
2006
 
1960
- self.reporter = Minitest::CompositeReporter.new
1961
- reporter << Class.new do
1962
- def start; end
1963
- # def prerecord klass, name; end
1964
- def record result; end
2007
+ bogus_reporter = Class.new do # doesn't subclass AbstractReporter
2008
+ def start; @success = false; end
2009
+ # def prerecord klass, name; end # doesn't define full API
2010
+ def record result; @success = true; end
1965
2011
  def report; end
1966
2012
  def passed?; end
1967
2013
  def results; end
2014
+ def success?; @success; end
1968
2015
  end.new
1969
2016
 
2017
+ self.reporter = Minitest::CompositeReporter.new
2018
+ reporter << bogus_reporter
2019
+
1970
2020
  Minitest::Runnable.runnables.delete @tu
1971
2021
 
1972
2022
  @tu.run reporter, {}
2023
+
2024
+ assert_predicate bogus_reporter, :success?
1973
2025
  end
1974
2026
 
1975
2027
  def test_record_passing
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.1
4
+ version: 5.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -30,36 +30,36 @@ cert_chain:
30
30
  E4oJcnPkJAr0rw504JGtlZtONZQblwmRJOIdXzolaE3NRGUzGVOUSptZppAKiavY
31
31
  fO6tdKQc/5RfA8oQEkg8hrxA5PQSz4TOFJGLpFvIapEk6tMruQ0bHgkhr9auXg==
32
32
  -----END CERTIFICATE-----
33
- date: 2016-12-02 00:00:00.000000000 Z
33
+ date: 2017-05-09 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rdoc
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '4.0'
42
42
  type: :development
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
48
  version: '4.0'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hoe
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ~>
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '3.15'
55
+ version: '3.16'
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ~>
60
+ - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '3.15'
62
+ version: '3.16'
63
63
  description: |-
64
64
  minitest provides a complete suite of testing facilities supporting
65
65
  TDD, BDD, mocking, and benchmarking.
@@ -123,7 +123,7 @@ extra_rdoc_files:
123
123
  - Manifest.txt
124
124
  - README.rdoc
125
125
  files:
126
- - .autotest
126
+ - ".autotest"
127
127
  - History.rdoc
128
128
  - Manifest.txt
129
129
  - README.rdoc
@@ -155,23 +155,23 @@ licenses:
155
155
  metadata: {}
156
156
  post_install_message:
157
157
  rdoc_options:
158
- - --main
158
+ - "--main"
159
159
  - README.rdoc
160
160
  require_paths:
161
161
  - lib
162
162
  required_ruby_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - '>='
169
+ - - ">="
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.4.5
174
+ rubygems_version: 2.6.8
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: minitest provides a complete suite of testing facilities supporting TDD,
metadata.gz.sig CHANGED
Binary file