Remove predicate methods from Result types

This commit is contained in:
Michael Miller 2019-02-17 13:15:40 -07:00
parent ed01a95e67
commit 8dd8db74b9
6 changed files with 0 additions and 90 deletions

View file

@ -6,10 +6,5 @@ module Spectator
# This is different from a "failed" result # This is different from a "failed" result
# in that the error was not from a failed expectation. # in that the error was not from a failed expectation.
class ErroredResult < FailedResult class ErroredResult < FailedResult
# Indicates whether an error was encountered while running the example.
# This will always be true for this type of result.
def errored?
true
end
end end
end end

View file

@ -18,25 +18,5 @@ module Spectator
def initialize(example, elapsed, @expectations, @error) def initialize(example, elapsed, @expectations, @error)
super(example, elapsed) super(example, elapsed)
end 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.
def passed?
false
end
# Indicates that an example was run, but it failed.
# Errors count as failures.
# This will always be true for this type of result.
def failed?
true
end
# Indicates whether an error was encountered while running the example.
# This will always be false for this type of result.
def errored?
false
end
end end
end end

View file

@ -11,11 +11,5 @@ module Spectator
def initialize(example, @elapsed) def initialize(example, @elapsed)
super(example) super(example)
end end
# Indicates that an example was marked as pending.
# This will always be false for this type of result.
def pending?
false
end
end end
end end

View file

@ -5,30 +5,5 @@ module Spectator
# A pending result means the example is not ready to run yet. # 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. # This can happen when the functionality to be tested is not implemented yet.
class PendingResult < Result class PendingResult < Result
# 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.
def passed?
false
end
# Indicates that an example was run, but it failed.
# Errors count as failures.
# This will always be false for this type of result.
def failed?
false
end
# Indicates whether an error was encountered while running the example.
# This will always be false for this type of result.
def errored?
false
end
# Indicates that an example was marked as pending.
# This will always be true for this type of result.
def pending?
true
end
end end
end end

View file

@ -5,20 +5,6 @@ module Spectator
# Example that was run that this result is for. # Example that was run that this result is for.
getter example : Example getter example : Example
# Indicates that an example was run and it was successful.
# NOTE: Examples with warnings count as successful.
abstract def passed? : Bool
# Indicates that an example was run, but it failed.
# Errors count as failures.
abstract def failed? : Bool
# Indicates whether an error was encountered while running the example.
abstract def errored? : Bool
# Indicates that an example was marked as pending.
abstract def pending? : Bool
# Constructs the base of the result. # Constructs the base of the 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.

View file

@ -14,25 +14,5 @@ module Spectator
def initialize(example, elapsed, @expectations) def initialize(example, elapsed, @expectations)
super(example, elapsed) super(example, elapsed)
end end
# Indicates that an example was run and it was successful.
# NOTE: Examples with warnings count as successful.
# This will always be true for this type of result.
def passed?
true
end
# Indicates that an example was run, but it failed.
# Errors count as failures.
# This will always be false for this type of result.
def failed?
false
end
# Indicates whether an error was encountered while running the example.
# This will always be false for this type of result.
def errored?
false
end
end end
end end