Ability to pass custom hooks to SpyExample

This commit is contained in:
Michael Miller 2018-12-07 17:01:23 -07:00
parent f20a0e2241
commit e87f0b5e64

View file

@ -29,8 +29,7 @@ class SpyExample < Spectator::RunnableExample
# Creates a spy example. # Creates a spy example.
# The block passed to this method will be executed when the example runs. # The block passed to this method will be executed when the example runs.
def self.create(&block) def self.create(hooks = Spectator::ExampleHooks.empty, &block)
hooks = Spectator::ExampleHooks.empty
group = Spectator::RootExampleGroup.new(hooks) group = Spectator::RootExampleGroup.new(hooks)
values = Spectator::Internals::SampleValues.empty values = Spectator::Internals::SampleValues.empty
new(group, values).tap do |example| new(group, values).tap do |example|