mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add secondary initializer
This commit is contained in:
parent
edbcff03a5
commit
4d38bf3ab2
2 changed files with 27 additions and 2 deletions
|
@ -42,6 +42,15 @@ module Spectator
|
|||
end
|
||||
end
|
||||
|
||||
# Creates the report.
|
||||
# This constructor is intended for reports of subsets of results.
|
||||
# The *results* are from running the examples in the test suite.
|
||||
# The runtime is calculated from the *results*.
|
||||
def initialize(results : Array(Result))
|
||||
runtime = results.each.compact_map(&.as?(FinishedResult)).sum(&.elapsed)
|
||||
initialize(results, runtime)
|
||||
end
|
||||
|
||||
# Number of examples.
|
||||
def example_count
|
||||
@results.size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue