Mixed in to Metadata for an ExampleGroup (extends MetadataHash) to support lazy evaluation of some values.
# File lib/rspec/core/metadata.rb, line 128 128: def container_stack 129: @container_stack ||= begin 130: groups = [group = self] 131: while group.has_key?(:example_group) 132: groups << group[:example_group] 133: group = group[:example_group] 134: end 135: groups 136: end 137: end
# File lib/rspec/core/metadata.rb, line 110 110: def described_class 111: container_stack.each do |g| 112: return g[:described_class] if g.has_key?(:described_class) 113: return g[:describes] if g.has_key?(:describes) 114: end 115: 116: container_stack.reverse.each do |g| 117: candidate = g[:description_args].first 118: return candidate unless String === candidate || Symbol === candidate 119: end 120: 121: nil 122: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.