mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move PassingExample to its own file
Missed this one when moving code around before.
This commit is contained in:
parent
f0204a32ea
commit
4a531bd83f
2 changed files with 23 additions and 24 deletions
23
spec/helpers/passing_example.cr
Normal file
23
spec/helpers/passing_example.cr
Normal file
|
@ -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
|
|
@ -10,27 +10,3 @@ class SpySUT
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in a new issue