Allow hooks and conditions to be passed to create

This commit is contained in:
Michael Miller 2019-04-22 18:22:12 -06:00
parent 29df8716de
commit b305c829be
2 changed files with 2 additions and 6 deletions

View file

@ -26,9 +26,7 @@ class FailingExample < Spectator::RunnableExample
end
# Creates a failing example.
def self.create
hooks = Spectator::ExampleHooks.empty
conditions = Spectator::ExampleConditions.empty
def self.create(hooks = Spectator::ExampleHooks.empty, conditions = Spectator::ExampleConditions.empty)
group = Spectator::RootExampleGroup.new(hooks, conditions)
values = Spectator::Internals::SampleValues.empty
new(group, values).tap do |example|

View file

@ -32,9 +32,7 @@ class PassingExample < Spectator::RunnableExample
end
# Creates a passing example.
def self.create
hooks = Spectator::ExampleHooks.empty
conditions = Spectator::ExampleConditions.empty
def self.create(hooks = Spectator::ExampleHooks.empty, conditions = Spectator::ExampleConditions.empty)
group = Spectator::RootExampleGroup.new(hooks, conditions)
values = Spectator::Internals::SampleValues.empty
new(group, values).tap do |example|