diff --git a/src/spectator/failed_result.cr b/src/spectator/failed_result.cr index 3c76695..f1d3526 100644 --- a/src/spectator/failed_result.cr +++ b/src/spectator/failed_result.cr @@ -6,17 +6,14 @@ module Spectator # Error that occurred while running the example. getter error : Exception - # The expectations that were run in the example. - getter expectations : Expectations::ExampleExpectations - # Creates a failed result. # The *example* should refer to the example that was run # and that this result is for. # The *elapsed* argument is the length of time it took to run the example. # The *expectations* references the expectations that were checked in the example. # The *error* is the exception that was raised to cause the failure. - def initialize(example, elapsed, @expectations, @error) - super(example, elapsed) + def initialize(example, elapsed, expectations, @error) + super(example, elapsed, expectations) end # Calls the `failure` method on *interface* and passes self. diff --git a/src/spectator/finished_result.cr b/src/spectator/finished_result.cr index 8b8bb6b..76f6eaa 100644 --- a/src/spectator/finished_result.cr +++ b/src/spectator/finished_result.cr @@ -4,11 +4,15 @@ module Spectator # Length of time it took to run the example. getter elapsed : Time::Span + # The expectations that were run in the example. + getter expectations : Expectations::ExampleExpectations + # Creates a successful result. # The *example* should refer to the example that was run # and that this result is for. # The *elapsed* argument is the length of time it took to run the example. - def initialize(example, @elapsed) + # The *expectations* references the expectations that were checked in the example. + def initialize(example, @elapsed, @expectations) super(example) end end diff --git a/src/spectator/successful_result.cr b/src/spectator/successful_result.cr index c84e1f3..23bad8b 100644 --- a/src/spectator/successful_result.cr +++ b/src/spectator/successful_result.cr @@ -3,18 +3,6 @@ require "./finished_result" module Spectator # Outcome that indicates running an example was successful. class SuccessfulResult < FinishedResult - # The expectations that were run in the example. - getter expectations : Expectations::ExampleExpectations - - # Creates a successful result. - # The *example* should refer to the example that was run - # and that this result is for. - # The *elapsed* argument is the length of time it took to run the example. - # The *expectations* references the expectations that were checked in the example. - def initialize(example, elapsed, @expectations) - super(example, elapsed) - end - # Calls the `success` method on *interface* and passes self. def call(interface) interface.success(self)