mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move the expectations attribute up to FinishedResult
This commit is contained in:
parent
847cc662bd
commit
eaf1d19feb
3 changed files with 7 additions and 18 deletions
|
@ -6,17 +6,14 @@ module Spectator
|
||||||
# Error that occurred while running the example.
|
# Error that occurred while running the example.
|
||||||
getter error : Exception
|
getter error : Exception
|
||||||
|
|
||||||
# The expectations that were run in the example.
|
|
||||||
getter expectations : Expectations::ExampleExpectations
|
|
||||||
|
|
||||||
# Creates a failed result.
|
# Creates a failed result.
|
||||||
# The *example* should refer to the example that was run
|
# The *example* should refer to the example that was run
|
||||||
# and that this result is for.
|
# and that this result is for.
|
||||||
# The *elapsed* argument is the length of time it took to run the example.
|
# 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 *expectations* references the expectations that were checked in the example.
|
||||||
# The *error* is the exception that was raised to cause the failure.
|
# The *error* is the exception that was raised to cause the failure.
|
||||||
def initialize(example, elapsed, @expectations, @error)
|
def initialize(example, elapsed, expectations, @error)
|
||||||
super(example, elapsed)
|
super(example, elapsed, expectations)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calls the `failure` method on *interface* and passes self.
|
# Calls the `failure` method on *interface* and passes self.
|
||||||
|
|
|
@ -4,11 +4,15 @@ module Spectator
|
||||||
# Length of time it took to run the example.
|
# Length of time it took to run the example.
|
||||||
getter elapsed : Time::Span
|
getter elapsed : Time::Span
|
||||||
|
|
||||||
|
# The expectations that were run in the example.
|
||||||
|
getter expectations : Expectations::ExampleExpectations
|
||||||
|
|
||||||
# Creates a successful result.
|
# Creates a successful result.
|
||||||
# The *example* should refer to the example that was run
|
# The *example* should refer to the example that was run
|
||||||
# and that this result is for.
|
# and that this result is for.
|
||||||
# The *elapsed* argument is the length of time it took to run the example.
|
# 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)
|
super(example)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,18 +3,6 @@ require "./finished_result"
|
||||||
module Spectator
|
module Spectator
|
||||||
# Outcome that indicates running an example was successful.
|
# Outcome that indicates running an example was successful.
|
||||||
class SuccessfulResult < FinishedResult
|
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.
|
# Calls the `success` method on *interface* and passes self.
|
||||||
def call(interface)
|
def call(interface)
|
||||||
interface.success(self)
|
interface.success(self)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue