Sha256: f0136f5651fc7061ab86b8b1c53220b9529b601ab833034175ed3519d3d86f84
Contents?: true
Size: 853 Bytes
Versions: 12
Compression:
Stored size: 853 Bytes
Contents
module ::RSpec::Core::Metadata class HashPopulator def populate_location_attributes backtrace = user_metadata.delete(:caller) # Throwing exceptions to get code location is expensive, so use this if the user supplied it, otherwise # keep empty stuff around so filter code does not crash # might have an empty array from caller which file_path_and_line_number_from doesn't like file_path, line_number = if backtrace && !backtrace.empty? file_path_and_line_number_from(backtrace) else ['', -1] end metadata[:file_path] = file_path metadata[:line_number] = line_number.to_i metadata[:location] = file_path.empty? ? '' : "#{file_path}:#{line_number}" end end end
Version data entries
12 entries across 12 versions & 1 rubygems