Object
Used internally to customize the behavior of the memoized hash when used in a `before(:all)` hook.
@private
# File lib/rspec/core/memoized_helpers.rb, line 91 def self.isolate_for_before_all(example_group_instance) example_group_instance.instance_eval do @__memoized = BeforeAllMemoizedHash.new(self) begin yield ensure @__memoized.preserve_accessed_lets @__memoized = nil end end end
# File lib/rspec/core/memoized_helpers.rb, line 126 def []=(key, value) @hash[key] = value end
# File lib/rspec/core/memoized_helpers.rb, line 104 def fetch(key, &block) description = if key == :subject "subject" else "let declaration `#{key}`" end ::RSpec.warn_deprecation WARNING: #{description} accessed in a `before(:all)` hook at: #{caller[1]}This is deprecated behavior that will not be supported in RSpec 3.`let` and `subject` declarations are not intended to be calledin a `before(:all)` hook, as they exist to define state thatis reset between each example, while `before(:all)` exists todefine state that is shared across examples in an example group. @hash.fetch(key, &block) end
Generated with the Darkfish Rdoc Generator 2.