Skip to content

Commit

Permalink
- Fixed bug where guard runs tests bypassing minitest/autorun and an …
Browse files Browse the repository at this point in the history
…ivar isn't set right. (darrencauthon)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8325]
  • Loading branch information
zenspider committed Mar 28, 2013
1 parent 511a232 commit 01428be
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/minitest/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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).

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 01428be

Please sign in to comment.