Skip to content

Commit

Permalink
Pushed down filter
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 5924]
  • Loading branch information
zenspider committed Oct 27, 2010
1 parent 9e0ff7e commit 573ddc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -6,12 +6,15 @@ require 'rubygems'
require 'hoe'

Hoe.plugin :seattlerb
Hoe.plugin :isolate

Hoe.spec 'minitest' do
developer 'Ryan Davis', 'ryand-ruby@zenspider.com'

self.rubyforge_name = "bfts"
self.testlib = :minitest

extra_deps << ['parallel']
end

def loc dir
Expand Down
10 changes: 5 additions & 5 deletions lib/minitest/unit.rb
Expand Up @@ -564,9 +564,6 @@ def _run_anything type
suites = TestCase.send "#{type}_suites"
return if suites.empty?

filter = options[:filter] || '/./'
filter = Regexp.new $1 if filter =~ /\/(.*)\//

start = Time.now

puts
Expand All @@ -577,7 +574,7 @@ def _run_anything type
sync = @@out.respond_to? :"sync=" # stupid emacs
old_sync, @@out.sync = @@out.sync, true if sync

results = suites.map { |suite| _run_suite suite, type, filter }
results = suites.map { |suite| _run_suite suite, type }

@test_count = results.inject(0) { |sum, (tc, ac)| sum + tc }
@assertion_count = results.inject(0) { |sum, (tc, ac)| sum + ac }
Expand All @@ -600,10 +597,13 @@ def _run_anything type
status
end

def _run_suite suite, type, filter
def _run_suite suite, type
header = "#{type}_suite_header"
puts send(header, suite) if respond_to? header

filter = options[:filter] || '/./'
filter = Regexp.new $1 if filter =~ /\/(.*)\//

assertions = suite.send("#{type}_methods").grep(filter).map { |method|
inst = suite.new method
inst._assertions = 0
Expand Down

0 comments on commit 573ddc1

Please sign in to comment.