Module: RSpec::Core::Metadata::GroupMetadataHash
- Defined in:
- lib/rspec/core/metadata.rb
Overview
Mixed in to Metadata for an ExampleGroup (extends MetadataHash) to support lazy evaluation of some values.
Instance Method Summary collapse
Instance Method Details
#container_stack ⇒ Object
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/rspec/core/metadata.rb', line 128 def container_stack @container_stack ||= begin groups = [group = self] while group.has_key?(:example_group) groups << group[:example_group] group = group[:example_group] end groups end end |
#described_class ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/rspec/core/metadata.rb', line 110 def described_class container_stack.each do |g| return g[:described_class] if g.has_key?(:described_class) return g[:describes] if g.has_key?(:describes) end container_stack.reverse.each do |g| candidate = g[:description_args].first return candidate unless String === candidate || Symbol === candidate end nil end |
#full_description ⇒ Object
124 125 126 |
# File 'lib/rspec/core/metadata.rb', line 124 def full_description build_description_from(*container_stack.reverse.map {|a| a[:description_args]}.flatten) end |