Result visitor methods should take result as argument

This commit is contained in:
Michael Miller 2021-05-16 12:19:16 -06:00
parent 9a62c1386a
commit 59c67c26a9
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD
5 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@ module Spectator
class ErrorResult < FailResult class ErrorResult < FailResult
# Calls the `error` method on *visitor*. # Calls the `error` method on *visitor*.
def accept(visitor) def accept(visitor)
visitor.error visitor.error(self)
end end
# Calls the `error` method on *visitor*. # Calls the `error` method on *visitor*.

View file

@ -17,7 +17,7 @@ module Spectator
# Calls the `failure` method on *visitor*. # Calls the `failure` method on *visitor*.
def accept(visitor) def accept(visitor)
visitor.fail visitor.fail(self)
end end
# Calls the `failure` method on *visitor*. # Calls the `failure` method on *visitor*.

View file

@ -5,7 +5,7 @@ module Spectator
class PassResult < Result class PassResult < Result
# Calls the `pass` method on *visitor*. # Calls the `pass` method on *visitor*.
def accept(visitor) def accept(visitor)
visitor.pass visitor.pass(self)
end end
# Calls the `pass` method on *visitor*. # Calls the `pass` method on *visitor*.

View file

@ -13,7 +13,7 @@ module Spectator
# Calls the `pending` method on the *visitor*. # Calls the `pending` method on the *visitor*.
def accept(visitor) def accept(visitor)
visitor.pending visitor.pending(self)
end end
# Calls the `pending` method on the *visitor*. # Calls the `pending` method on the *visitor*.

View file

@ -49,22 +49,22 @@ module Spectator
end end
# Invokes the example passed method. # Invokes the example passed method.
def pass def pass(_result)
@formatter.example_passed(@notification) @formatter.example_passed(@notification)
end end
# Invokes the example failed method. # Invokes the example failed method.
def fail def fail(_result)
@formatter.example_failed(@notification) @formatter.example_failed(@notification)
end end
# Invokes the example error method. # Invokes the example error method.
def error def error(_result)
@formatter.example_error(@notification) @formatter.example_error(@notification)
end end
# Invokes the example pending method. # Invokes the example pending method.
def pending def pending(_result)
@formatter.example_pending(@notification) @formatter.example_pending(@notification)
end end
end end