From c48467f78307de386b389189a2dcb185fe517e16 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 19 Oct 2018 18:50:21 -0600 Subject: [PATCH] Slightly better wording and naming --- src/spectator/example.cr | 4 ++-- src/spectator/pending_example.cr | 2 +- src/spectator/runnable_example.cr | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/spectator/example.cr b/src/spectator/example.cr index f3dd39c..c7388a5 100644 --- a/src/spectator/example.cr +++ b/src/spectator/example.cr @@ -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. diff --git a/src/spectator/pending_example.cr b/src/spectator/pending_example.cr index a107fd5..897b134 100644 --- a/src/spectator/pending_example.cr +++ b/src/spectator/pending_example.cr @@ -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 diff --git a/src/spectator/runnable_example.cr b/src/spectator/runnable_example.cr index edae6de..b456760 100644 --- a/src/spectator/runnable_example.cr +++ b/src/spectator/runnable_example.cr @@ -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