@private
@private Supports lazy evaluation of some values. Extended by ExampleMetadataHash and GroupMetadataHash, which get mixed in to Metadata for ExampleGroups and Examples (respectively).
# File lib/rspec/core/metadata.rb, line 43 43: def [](key) 44: return super if has_key?(key) 45: case key 46: when :location 47: store(:location, location) 48: when :file_path, :line_number 49: file_path, line_number = file_and_line_number 50: store(:file_path, file_path) 51: store(:line_number, line_number) 52: super 53: when :execution_result 54: store(:execution_result, {}) 55: when :describes, :described_class 56: klass = described_class 57: store(:described_class, klass) 58: # TODO (2011-11-07 DC) deprecate :describes as a key 59: store(:describes, klass) 60: when :full_description 61: store(:full_description, full_description) 62: when :description 63: store(:description, build_description_from(*self[:description_args])) 64: else 65: super 66: end 67: end
# File lib/rspec/core/metadata.rb, line 84 84: def build_description_from(*parts) 85: parts.map {|p| p.to_s}.inject do |desc, p| 86: p =~ /^(#|::|\.)/ ? "#{desc}#{p}" : "#{desc} #{p}" 87: end || "" 88: end
# File lib/rspec/core/metadata.rb, line 75 75: def file_and_line_number 76: first_caller_from_outside_rspec =~ /(.+?):(\d+)(|:\d+)/ 77: return [Metadata::relative_path($1), $2.to_i] 78: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.