class RSpec::Core::MemoizedHelpers::ContextHookMemoized

@private
memoized hash when used in a ‘before(:context)` hook.
Used internally to customize the behavior of the

def self.fetch_or_store(key, &_block)

def self.fetch_or_store(key, &_block)
  description = if key == :subject
                  "subject"
                else
                  "let declaration `#{key}`"
                end
  raise <<-EOS
ption} accessed in #{article} #{hook_expression} hook at:
erFilter.first_non_rspec_line}
d `subject` declarations are not intended to be called
icle} #{hook_expression} hook, as they exist to define state that
 between each example, while #{hook_expression} exists to
ntention}.
end

def self.isolate_for_context_hook(example_group_instance)

def self.isolate_for_context_hook(example_group_instance)
  exploding_memoized = self
  example_group_instance.instance_exec do
    @__memoized = exploding_memoized
    begin
      yield
    ensure
      # This is doing a reset instead of just isolating for context hook.
      # Really, this should set the old @__memoized back into place.
      #
      # Caller is the before and after context hooks
      # which are both called from self.run
      # I didn't look at why it made tests fail, maybe an object was getting reused in RSpec tests,
      # if so, then that probably already works, and its the tests that are wrong.
      __init_memoized
    end
  end
end