mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Slightly better wording and naming
This commit is contained in:
parent
36071fcdbf
commit
c48467f783
3 changed files with 7 additions and 7 deletions
|
@ -17,11 +17,11 @@ module Spectator
|
|||
def run : Result
|
||||
raise "Attempted to run example more than once (#{self})" if finished?
|
||||
@finished = true
|
||||
run_inner
|
||||
run_impl
|
||||
end
|
||||
|
||||
# Implementation-specific for running the example code.
|
||||
private abstract def run_inner : Result
|
||||
private abstract def run_impl : Result
|
||||
|
||||
# Creates the base of the example.
|
||||
# The group should be the example group the example belongs to.
|
||||
|
|
|
@ -5,7 +5,7 @@ module Spectator
|
|||
# This class will not run example code.
|
||||
abstract class PendingExample < Example
|
||||
# Returns a pending result.
|
||||
private def run_inner : Result
|
||||
private def run_impl : Result
|
||||
PendingResult.new(self)
|
||||
end
|
||||
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_inner : Result
|
||||
def run_impl : Result
|
||||
result = capture_result
|
||||
expectations = Internals::Harness.current.expectation_results
|
||||
translate_result(result, expectations)
|
||||
|
@ -41,7 +41,7 @@ module Spectator
|
|||
private def capture_result : ResultCapture
|
||||
ResultCapture.new.tap do |result|
|
||||
# Get the proc that will call around-each hooks and the example.
|
||||
wrapper = wrapped_run_example(result)
|
||||
wrapper = wrap_run_example(result)
|
||||
begin
|
||||
run_before_hooks
|
||||
wrapper.call
|
||||
|
@ -53,7 +53,7 @@ module Spectator
|
|||
|
||||
# Creates a proc that runs the test code
|
||||
# and captures the result.
|
||||
private def wrapped_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
|
||||
|
@ -67,7 +67,7 @@ module Spectator
|
|||
# Capture how long it takes to run the test code.
|
||||
result.elapsed = Time.measure do
|
||||
begin
|
||||
# Actually go run the example code.
|
||||
# Actually run the example code.
|
||||
run_instance
|
||||
rescue ex # Catch all errors and handle them later.
|
||||
result.error = ex
|
||||
|
|
Loading…
Reference in a new issue