mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
Fix total count when filters given
This commit is contained in:
parent
f13068afaa
commit
ff4c98f125
1 changed files with 8 additions and 5 deletions
|
@ -964,11 +964,14 @@ module Test
|
||||||
@output = Output.new(self) unless @options[:testing]
|
@output = Output.new(self) unless @options[:testing]
|
||||||
filter = options[:filter]
|
filter = options[:filter]
|
||||||
type = "#{type}_methods"
|
type = "#{type}_methods"
|
||||||
total = if filter
|
total = suites.sum {|suite|
|
||||||
suites.inject(0) {|n, suite| n + suite.send(type).grep(filter).size}
|
methods = suite.send(type)
|
||||||
else
|
if filter
|
||||||
suites.inject(0) {|n, suite| n + suite.send(type).size}
|
methods.count {|method| filter === "#{suite}##{method}"}
|
||||||
end
|
else
|
||||||
|
methods.size
|
||||||
|
end
|
||||||
|
}
|
||||||
@test_count = 0
|
@test_count = 0
|
||||||
@total_tests = total.to_s(10)
|
@total_tests = total.to_s(10)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue