Module: Selective::Ruby::RSpec::Monkeypatches::MetaHashPopulator

Defined in:
lib/selective/ruby/rspec/monkeypatches.rb

Instance Method Summary collapse

Instance Method Details

#file_path_and_line_number_from(backtrace) ⇒ Object



136
137
138
139
140
141
# File 'lib/selective/ruby/rspec/monkeypatches.rb', line 136

def file_path_and_line_number_from(backtrace)
  return super if ::RSpec.configuration.currently_loading_spec_file.nil?

  filtered = backtrace.find { |l| l.include? ::RSpec.configuration.currently_loading_spec_file }
  filtered.nil? ? super : super([filtered])
end

#populate_location_attributesObject



131
132
133
134
# File 'lib/selective/ruby/rspec/monkeypatches.rb', line 131

def populate_location_attributes
  [:caller] ||= caller unless ::RSpec.configuration.currently_loading_spec_file.nil?
  super
end