From e87f0b5e64bc921d7d8a45a05e33464659b956de Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 7 Dec 2018 17:01:23 -0700 Subject: [PATCH] Ability to pass custom hooks to SpyExample --- spec/helpers/spy_example.cr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/helpers/spy_example.cr b/spec/helpers/spy_example.cr index 626f3ce..0e5b87f 100644 --- a/spec/helpers/spy_example.cr +++ b/spec/helpers/spy_example.cr @@ -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|