minitest 5.11.1 → 5.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4532535af505aea7a24c6a12ed614dc4daac90f7
4
- data.tar.gz: f046da3055edc520f92fd89a7337d14073068100
2
+ SHA256:
3
+ metadata.gz: 0d02b78e719c5f0e0d66c70ce7d14dec24cd6b9238927d8aa4c7140ef0a9c73f
4
+ data.tar.gz: 558f87be0d0a767424bfaaef04bcebfa889ea946e46ab5e1ca0857a3016df2a3
5
5
  SHA512:
6
- metadata.gz: fa14c057616423821c8e5afeaf80068fdb63f0e596c85dae9dbe64c307269c08e10a126db0807eb2a0077ed9b2886ceae264aeb4beb213fa6efbaed25ea69312
7
- data.tar.gz: f810e3d8ffab481cf3fe9720735eaf44a099b824a591fc510bde5c204ad27242bf784850cef9b2cf5f9d4f879ffa40834a243d1eb1cb04d5a9a3091b2c50402f
6
+ metadata.gz: d5f6dace06643179027dad2514c33d546a00b18525237ea296570b5e575ff5144c39fef97f02dabba4ca778d0181d7e16718ca9aba58d33c6b2a489105a62263
7
+ data.tar.gz: bfbbbbb1d3e72976e0a162524e0026b4342a4e3395a601f1931384b511f85885e9d148cc3c855db98df01f9477ab5808495e942b9ab5e11d8b7b1ccc091389db
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,14 @@
1
+ === 5.11.2 / 2018-01-25
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Reversed Test < Result. Back to < Runnable and using Reportable for shared code.
6
+
7
+ * 2 bug fixes:
8
+
9
+ * Fixed Result#location for instances of Test. (alexisbernard)
10
+ * Fixed deprecation message for Runnable#marshal_dump. (y-yagi)
11
+
1
12
  === 5.11.1 / 2018-01-02
2
13
 
3
14
  * 1 bug fix:
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.11.1" # :nodoc:
11
+ VERSION = "5.11.2" # :nodoc:
12
12
  ENCS = "".respond_to? :encoding # :nodoc:
13
13
 
14
14
  @@installed_at_exit ||= false
@@ -381,7 +381,7 @@ module Minitest
381
381
 
382
382
  def marshal_dump # :nodoc:
383
383
  unless @@marshal_dump_warned then
384
- warn ["Minitest::Test#marshal_dump is deprecated.",
384
+ warn ["Minitest::Runnable#marshal_dump is deprecated.",
385
385
  "You might be violating internals. From", caller.first].join " "
386
386
  @@marshal_dump_warned = true
387
387
  end
@@ -436,6 +436,49 @@ module Minitest
436
436
  end
437
437
  end
438
438
 
439
+ ##
440
+ # Shared code for anything that can get passed to a Reporter. See
441
+ # Minitest::Test & Minitest::Result.
442
+
443
+ module Reportable
444
+ ##
445
+ # Did this run pass?
446
+ #
447
+ # Note: skipped runs are not considered passing, but they don't
448
+ # cause the process to exit non-zero.
449
+
450
+ def passed?
451
+ not self.failure
452
+ end
453
+
454
+ ##
455
+ # The location identifier of this test. Depends on a method
456
+ # existing called class_name.
457
+
458
+ def location
459
+ loc = " [#{self.failure.location}]" unless passed? or error?
460
+ "#{self.class_name}##{self.name}#{loc}"
461
+ end
462
+
463
+ def class_name # :nodoc:
464
+ raise NotImplementedError, "subclass responsibility"
465
+ end
466
+
467
+ ##
468
+ # Returns ".", "F", or "E" based on the result of the run.
469
+
470
+ def result_code
471
+ self.failure and self.failure.result_code or "."
472
+ end
473
+
474
+ ##
475
+ # Was this run skipped?
476
+
477
+ def skipped?
478
+ self.failure and Skip === self.failure
479
+ end
480
+ end
481
+
439
482
  ##
440
483
  # This represents a test result in a clean way that can be
441
484
  # marshalled over a wire. Tests can do anything they want to the
@@ -444,6 +487,8 @@ module Minitest
444
487
  # that the test result can be marshalled.
445
488
 
446
489
  class Result < Runnable
490
+ include Minitest::Reportable
491
+
447
492
  undef_method :marshal_dump
448
493
  undef_method :marshal_load
449
494
 
@@ -481,36 +526,8 @@ module Minitest
481
526
  self.failures.any? { |f| UnexpectedError === f }
482
527
  end
483
528
 
484
- ##
485
- # The location identifier of this test.
486
-
487
- def location
488
- loc = " [#{self.failure.location}]" unless passed? or error?
489
- "#{self.klass}##{self.name}#{loc}"
490
- end
491
-
492
- ##
493
- # Did this run pass?
494
- #
495
- # Note: skipped runs are not considered passing, but they don't
496
- # cause the process to exit non-zero.
497
-
498
- def passed?
499
- not self.failure
500
- end
501
-
502
- ##
503
- # Returns ".", "F", or "E" based on the result of the run.
504
-
505
- def result_code
506
- self.failure and self.failure.result_code or "."
507
- end
508
-
509
- ##
510
- # Was this run skipped?
511
-
512
- def skipped?
513
- self.failure and Skip === self.failure
529
+ def class_name # :nodoc:
530
+ self.klass # for Minitest::Reportable
514
531
  end
515
532
 
516
533
  def to_s # :nodoc:
@@ -53,7 +53,7 @@ module Minitest
53
53
  end
54
54
  end
55
55
 
56
- module Test
56
+ module Test # :nodoc:
57
57
  def _synchronize; Minitest::Test.io_lock.synchronize { yield }; end # :nodoc:
58
58
 
59
59
  module ClassMethods # :nodoc:
data/lib/minitest/test.rb CHANGED
@@ -7,9 +7,14 @@ module Minitest
7
7
  #
8
8
  # See Minitest::Assertions
9
9
 
10
- class Test < Result
10
+ class Test < Runnable
11
11
  require "minitest/assertions"
12
12
  include Minitest::Assertions
13
+ include Minitest::Reportable
14
+
15
+ def class_name # :nodoc:
16
+ self.class.name # for Minitest::Reportable
17
+ end
13
18
 
14
19
  PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, SystemExit] # :nodoc:
15
20
 
@@ -509,7 +509,9 @@ describe Minitest::Spec do
509
509
 
510
510
  it "can NOT use must_equal in a thread. It must use expect in a thread" do
511
511
  assert_raises NoMethodError do
512
- Thread.new { (1 + 1).must_equal 2 }.join
512
+ capture_io do
513
+ Thread.new { (1 + 1).must_equal 2 }.join
514
+ end
513
515
  end
514
516
  end
515
517
  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.11.1
4
+ version: 5.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  AhXhF6Wi2GTMezlj5jlI5XV7WsJUSwTp/YiVvcmT74ZaCRvexm6EnNhkrvJJ1Xeu
30
30
  V+HB+LYYhXWitInO/eXxDrFB
31
31
  -----END CERTIFICATE-----
32
- date: 2018-01-02 00:00:00.000000000 Z
32
+ date: 2018-01-25 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.6.13
173
+ rubygems_version: 2.7.3
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: minitest provides a complete suite of testing facilities supporting TDD,
metadata.gz.sig CHANGED
Binary file