Remove elapsed time from pending results

This commit is contained in:
Michael Miller 2019-02-12 16:36:06 -07:00
parent 577877e067
commit 493e30acee
4 changed files with 1 additions and 15 deletions

View file

@ -36,10 +36,4 @@ describe Spectator::PendingResult do
result.example.should eq(example)
end
end
describe "#elapsed" do
it "is zero" do
new_pending_result.elapsed.should eq(Time::Span.zero)
end
end
end

View file

@ -148,7 +148,7 @@ describe Spectator::Runner do
spy = SpyFormatter.new
runner = Spectator::Runner.new(suite, spectator_test_config(spy))
max_time = Time.measure { runner.run }
min_time = spy.end_example_calls.sum(&.elapsed)
min_time = spy.end_example_calls.each.map(&.as(Spectator::FinishedResult)).sum(&.elapsed)
report = spy.end_suite_calls.first
report.runtime.should be <= max_time
report.runtime.should be >= min_time

View file

@ -5,11 +5,6 @@ module Spectator
# A pending result means the example is not ready to run yet.
# This can happen when the functionality to be tested is not implemented yet.
class PendingResult < Result
# Length of time it took to run the example.
def elapsed : Time::Span
Time::Span.zero
end
# Indicates that an example was run and it was successful.
# NOTE: Examples with warnings count as successful.
# This will always be false for this type of result.

View file

@ -5,9 +5,6 @@ module Spectator
# Example that was run that this result is for.
getter example : Example
# Length of time it took to run the example.
abstract def elapsed : Time::Span
# Indicates that an example was run and it was successful.
# NOTE: Examples with warnings count as successful.
abstract def passed? : Bool