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
1 changed files with 1 additions and 2 deletions

View File

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