From 4a531bd83fecd31df879b1e3fccf475b241e5060 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 14 Nov 2018 12:55:21 -0700 Subject: [PATCH] Move PassingExample to its own file Missed this one when moving code around before. --- spec/helpers/passing_example.cr | 23 +++++++++++++++++++++++ spec/helpers/spy_sut.cr | 24 ------------------------ 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 spec/helpers/passing_example.cr diff --git a/spec/helpers/passing_example.cr b/spec/helpers/passing_example.cr new file mode 100644 index 0000000..09ce333 --- /dev/null +++ b/spec/helpers/passing_example.cr @@ -0,0 +1,23 @@ +# Example that always succeeds. +class PassingExample < Spectator::RunnableExample + # Dummy description. + def what + "PASS" + end + + # Run the example that always passes. + # If this doesn't something broke. + private def run_instance + report_expectations(1, 0) + end + + # Creates a passing example. + def self.create + hooks = Spectator::ExampleHooks.empty + group = Spectator::RootExampleGroup.new(hooks) + values = Spectator::Internals::SampleValues.empty + new(group, values).tap do |example| + group.children = [example.as(Spectator::ExampleComponent)] + end + end +end diff --git a/spec/helpers/spy_sut.cr b/spec/helpers/spy_sut.cr index 5f0b2ca..ef86b3a 100644 --- a/spec/helpers/spy_sut.cr +++ b/spec/helpers/spy_sut.cr @@ -10,27 +10,3 @@ class SpySUT true end end - -# Example that always succeeds. -class PassingExample < Spectator::RunnableExample - # Dummy description. - def what - "PASS" - end - - # Run the example that always passes. - # If this doesn't something broke. - private def run_instance - report_expectations(1, 0) - end - - # Creates a passing example. - def self.create - hooks = Spectator::ExampleHooks.empty - group = Spectator::RootExampleGroup.new(hooks) - values = Spectator::Internals::SampleValues.empty - new(group, values).tap do |example| - group.children = [example.as(Spectator::ExampleComponent)] - end - end -end