class Utils::LineFormatter

def location(example)

Returns:
  • (String) - the relative file path and line number for the example

Parameters:
  • example (Object) -- the RSpec example object containing metadata
def location(example)
  location = example.example.metadata[:location]
  unless location.include?(?/)
    location = example.example.metadata[:example_group][:location]
  end
  RSpec::Core::Metadata::relative_path(location)
end