module RSpec::Core::Metadata
def self.backtrace_from(block)
- Private: -
def self.backtrace_from(block) return caller unless block.respond_to?(:source_location) [block.source_location.join(':')] end
def self.build_hash_from(args, warn_about_example_group_filtering=false)
- Private: -
def self.build_hash_from(args, warn_about_example_group_filtering=false) hash = args.last.is_a?(Hash) ? args.pop : {} hash[args.pop] = true while args.last.is_a?(Symbol) if warn_about_example_group_filtering && hash.key?(:example_group) RSpec.deprecate("Filtering by an `:example_group` subhash", :replacement => "the subhash to filter directly") end hash end
def self.relative_path(line)
-
(String)
- relative path to line
Parameters:
-
line
(String
) -- current code line
Other tags:
- Api: - private
def self.relative_path(line) line = line.sub(File.expand_path("."), ".") line = line.sub(/\A([^:]+:\d+)$/, '\\1') return nil if line == '-e:1' line rescue SecurityError nil end