Permalink
Browse files

- Fixed bug where guard runs tests bypassing minitest/autorun and an …

…ivar isn't set right. (darrencauthon)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8325]
  • Loading branch information...
1 parent 511a232 commit 01428befbcf2ce62ec5ccad450a1a86f6d22654e @zenspider zenspider committed Mar 28, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/minitest/unit.rb
@@ -729,7 +729,8 @@ class Unit # :nodoc:
VERSION = "4.7.0" # :nodoc:
attr_accessor :report, :failures, :errors, :skips # :nodoc:
- attr_accessor :test_count, :assertion_count # :nodoc:
+ attr_accessor :assertion_count # :nodoc:
+ attr_writer :test_count # :nodoc:
attr_accessor :start_time # :nodoc:
attr_accessor :help # :nodoc:
attr_accessor :verbose # :nodoc:
@@ -836,6 +837,10 @@ def print *a # :nodoc:
output.print(*a)
end
+ def test_count # :nodoc:
+ @test_count ||= 0
+ end
+
##
# Runner for a given +type+ (eg, test vs bench).
@@ -1051,7 +1056,7 @@ def _run args = []
break unless report.empty?
end
- return failures + errors if @test_count > 0 # or return nil...
+ return failures + errors if self.test_count > 0 # or return nil...
rescue Interrupt
abort 'Interrupted'
end

0 comments on commit 01428be

Please sign in to comment.