minitest 5.7.0 → 5.8.0

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
2
  SHA1:
3
- metadata.gz: f0caf7dee527cd6e2c8723c758f8f8b77200394e
4
- data.tar.gz: 733ef8e073ffc22f3fde80f0943e211d44f1682e
3
+ metadata.gz: cadf6da908e8558c23ccb2b48f04440c58548170
4
+ data.tar.gz: 3da4643eb6db1d74cdac7ba8aaa47f74865ae5fb
5
5
  SHA512:
6
- metadata.gz: a439887e2b4866360f82a8f69d4e6987e04ddcaa46a4657c7197a67f7421236b40a90489d3b6d8dbb1a29aa9964e52764b3e168e37a8934889984a959748d857
7
- data.tar.gz: 4b0d8456d19c64ec581fa5bbb5636c185653d817b93045903f7b0a05f38b28d113ecfae7f2911722b5f3e9deb96c26ac401e0afbe6b5430a69683acf0940e4cf
6
+ metadata.gz: 8c522d5cd91d724391203d28a4e18310113c368d42da3e3a068733414db307b8368a1fd4a28567bc9da19d6c374b7dffee98efe37deb53273f390f7c911c8d4f
7
+ data.tar.gz: 4935850af98ba3ea0c2a784333d1c831c4feea72c5b88a903006d1feeba87aebabf02c47b81869d1cbf4eade1dcfda95216b2512509d1c61b2bfd739fad92039
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,14 @@
1
+ === 5.8.0 / 2015-08-06
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Add optional delegation mechanism to extend object with a mock. (zamith)
6
+ * Return early if there are no filtered methods. (jeremyevans)
7
+
8
+ * 1 bug fix:
9
+
10
+ * Don't extend io with pride if io is not a tty. (toy)
11
+
1
12
  === 5.7.0 / 2015-05-27
2
13
 
3
14
  * 1 major enhancement:
@@ -446,7 +446,6 @@ color_pound_spec_reporter :: Test names print Ruby Object types in color with
446
446
  minispec-metadata :: Metadata for describe/it blocks & CLI tag filter.
447
447
  E.g. `it "requires JS driver", js: true do` &
448
448
  `ruby test.rb --tag js` runs tests tagged :js.
449
- minitest-ansi :: Colorize minitest output with ANSI colors.
450
449
  minitest-around :: Around block for minitest. An alternative to
451
450
  setup/teardown dance.
452
451
  minitest-autotest :: autotest is a continous testing facility meant to
@@ -462,8 +461,6 @@ minitest-capybara :: Capybara matchers support for minitest unit and
462
461
  spec.
463
462
  minitest-chef-handler :: Run Minitest suites as Chef report handlers
464
463
  minitest-ci :: CI reporter plugin for Minitest.
465
- minitest-colorize :: Colorize Minitest output and show failing tests
466
- instantly.
467
464
  minitest-context :: Defines contexts for code reuse in Minitest
468
465
  specs that share common expectations.
469
466
  minitest-debugger :: Wraps assert so failed assertions drop into
@@ -552,7 +549,6 @@ minitest-unordered :: Adds a new assertion to minitest for checking the
552
549
  contents of a collection, ignoring element order.
553
550
  minitest-vcr :: Automatic cassette managment with Minitest::Spec
554
551
  and VCR.
555
- minitest-wscolor :: Yet another test colorizer.
556
552
  minitest_owrapper :: Get tests results as a TestResult object.
557
553
  minitest_should :: Shoulda style syntax for minitest test::unit.
558
554
  minitest_tu_shim :: Bridges between test/unit and minitest.
@@ -7,7 +7,7 @@ require "minitest/parallel"
7
7
  # :include: README.rdoc
8
8
 
9
9
  module Minitest
10
- VERSION = "5.7.0" # :nodoc:
10
+ VERSION = "5.8.0" # :nodoc:
11
11
  ENCS = "".respond_to? :encoding # :nodoc:
12
12
 
13
13
  @@installed_at_exit ||= false
@@ -289,6 +289,8 @@ module Minitest
289
289
  filter === m || filter === "#{self}##{m}"
290
290
  }
291
291
 
292
+ return if filtered_methods.empty?
293
+
292
294
  with_info_handler reporter do
293
295
  filtered_methods.each do |method_name|
294
296
  run_one_method self, method_name, reporter
@@ -37,7 +37,8 @@ module Minitest # :nodoc:
37
37
  end
38
38
  end
39
39
 
40
- def initialize # :nodoc:
40
+ def initialize(delegator = nil) # :nodoc:
41
+ @delegator = delegator
41
42
  @expected_calls = Hash.new { |calls, name| calls[name] = [] }
42
43
  @actual_calls = Hash.new { |calls, name| calls[name] = [] }
43
44
  end
@@ -111,8 +112,12 @@ module Minitest # :nodoc:
111
112
 
112
113
  def method_missing(sym, *args, &block) # :nodoc:
113
114
  unless @expected_calls.key?(sym) then
114
- raise NoMethodError, "unmocked method %p, expected one of %p" %
115
- [sym, @expected_calls.keys.sort_by(&:to_s)]
115
+ if @delegator && @delegator.respond_to?(sym)
116
+ return @delegator.public_send(sym, *args, &block)
117
+ else
118
+ raise NoMethodError, "unmocked method %p, expected one of %p" %
119
+ [sym, @expected_calls.keys.sort_by(&:to_s)]
120
+ end
116
121
  end
117
122
 
118
123
  index = @actual_calls[sym].length
@@ -161,6 +166,7 @@ module Minitest # :nodoc:
161
166
 
162
167
  def respond_to?(sym, include_private = false) # :nodoc:
163
168
  return true if @expected_calls.key? sym.to_sym
169
+ return true if @delegator && @delegator.respond_to?(sym, include_private)
164
170
  __respond_to?(sym, include_private)
165
171
  end
166
172
  end
@@ -13,7 +13,7 @@ module Minitest
13
13
  io = klass.new options[:io]
14
14
 
15
15
  self.reporter.reporters.grep(Minitest::Reporter).each do |rep|
16
- rep.io = io
16
+ rep.io = io if rep.io.tty?
17
17
  end
18
18
  end
19
19
  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.7.0
4
+ version: 5.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
30
30
  VpzF30vNaJK6ZT7xlIsIlwmH
31
31
  -----END CERTIFICATE-----
32
- date: 2015-05-27 00:00:00.000000000 Z
32
+ date: 2015-08-06 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
metadata.gz.sig CHANGED
Binary file