Adjust (mostly remove) explicit return types
This commit is contained in:
parent
b646b8bec5
commit
f2c17189fc
|
@ -118,7 +118,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Checks whether all examples in the group have been run.
|
||||
def finished? : Bool
|
||||
def finished?
|
||||
children.all?(&.finished?)
|
||||
end
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ module Spectator
|
|||
# in addition to a block passed to this method.
|
||||
# To call the block and all "around-each" hooks,
|
||||
# just invoke `Proc#call` on the returned proc.
|
||||
def wrap_around_each(&block : ->)
|
||||
def wrap_around_each(&block : ->) : ->
|
||||
wrapper = block
|
||||
# Must wrap in reverse order,
|
||||
# otherwise hooks will run in the wrong order.
|
||||
|
|
|
@ -5,7 +5,7 @@ module Spectator
|
|||
# This class will not run example code.
|
||||
abstract class PendingExample < Example
|
||||
# Returns a pending result.
|
||||
private def run_impl : Result
|
||||
private def run_impl
|
||||
PendingResult.new(self)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ module Spectator
|
|||
# The root has no parent.
|
||||
class RootExampleGroup < ExampleGroup
|
||||
# Dummy value - this should never be used.
|
||||
def what : String
|
||||
def what
|
||||
"ROOT"
|
||||
end
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ module Spectator
|
|||
abstract class RunnableExample < Example
|
||||
# Runs the example, hooks, and captures the result
|
||||
# and translates to a usable result.
|
||||
def run_impl : Result
|
||||
def run_impl
|
||||
result = capture_result
|
||||
expectations = Internals::Harness.current.expectations
|
||||
translate_result(result, expectations)
|
||||
|
@ -35,7 +35,7 @@ module Spectator
|
|||
|
||||
# Runs all hooks and the example code.
|
||||
# A captured result is returned.
|
||||
private def capture_result : ResultCapture
|
||||
private def capture_result
|
||||
ResultCapture.new.tap do |result|
|
||||
# Get the proc that will call around-each hooks and the example.
|
||||
wrapper = wrap_run_example(result)
|
||||
|
@ -57,7 +57,7 @@ module Spectator
|
|||
|
||||
# Creates a proc that runs the test code
|
||||
# and captures the result.
|
||||
private def wrap_run_example(result) : ->
|
||||
private def wrap_run_example(result)
|
||||
# Wrap the method that runs and captures
|
||||
# the test code with the around-each hooks.
|
||||
group.wrap_around_each_hooks do
|
||||
|
|
|
@ -28,7 +28,7 @@ module Spectator
|
|||
|
||||
# Runs a single example and returns the result.
|
||||
# The formatter is given the example and result information.
|
||||
private def run_example(example) : Result
|
||||
private def run_example(example)
|
||||
@config.formatter.start_example(example)
|
||||
Internals::Harness.run(example).tap do |result|
|
||||
@config.formatter.end_example(result)
|
||||
|
|
Loading…
Reference in New Issue