diff --git a/src/spectator/harness.cr b/src/spectator/harness.cr index 70ad610..537bbf2 100644 --- a/src/spectator/harness.cr +++ b/src/spectator/harness.cr @@ -59,7 +59,7 @@ module Spectator # The example the harness is for should be passed in. private def initialize(@example) @reporter = Expectations::ExpectationReporter.new - @mocks = Mocks::Registry.new(@example.group.context.stubs) + @mocks = Mocks::Registry.new(@example.group.context) end end end diff --git a/src/spectator/mocks/registry.cr b/src/spectator/mocks/registry.cr index 31c956b..2791bc5 100644 --- a/src/spectator/mocks/registry.cr +++ b/src/spectator/mocks/registry.cr @@ -10,8 +10,8 @@ module Spectator::Mocks @all_instances = {} of String => Entry @entries = {} of Key => Entry - def initialize(default_stubs) - @all_instances = default_stubs.map do |k, v| + def initialize(context : TestContext) + @all_instances = context.stubs.map do |k, v| entry = Entry.new entry.stubs.concat(v) {k, entry}