class RSpec::Core::Example

def location_rerun_argument

Returns the location-based argument that can be passed to the `rspec` command to rerun this example.
def location_rerun_argument
  @location_rerun_argument ||= begin
    loaded_spec_files = RSpec.configuration.loaded_spec_files
    Metadata.ascending(metadata) do |meta|
      return meta[:location] if loaded_spec_files.include?(meta[:absolute_file_path])
    end
  end
end