Pass test context to registry

This commit is contained in:
Michael Miller 2019-11-10 13:08:43 -07:00
parent 2bc4f71edb
commit d2e27d1e6e
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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}