class RSpec::Core::SharedExampleGroupInclusionStackFrame

Contains information about the inclusion site of a shared example group.

def self.current_backtrace

Other tags:
    Private: -
def self.current_backtrace
  shared_example_group_inclusions.reverse
end

def self.shared_example_group_inclusions

Other tags:
    Private: -
def self.shared_example_group_inclusions
  RSpec::Support.thread_local_data[:shared_example_group_inclusions] ||= []
end

def self.with_frame(name, location)

Other tags:
    Private: -
def self.with_frame(name, location)
  current_stack = shared_example_group_inclusions
  if current_stack.any? { |frame| frame.shared_group_name == name }
    raise ArgumentError, "can't include shared examples recursively"
  else
    current_stack << new(name, location)
    yield
  end
ensure
  current_stack.pop
end

def description

Returns:
  • (String) - Description of this stack frame, in the form used by
def description
  @description ||= "Shared Example Group: #{shared_group_name.inspect} " \
    "called from #{formatted_inclusion_location}"
end

def formatted_inclusion_location

Returns:
  • (String) - The {#inclusion_location}, formatted for display by a formatter.
def formatted_inclusion_location
  @formatted_inclusion_location ||= begin
    RSpec.configuration.backtrace_formatter.backtrace_line(
      inclusion_location.sub(/(:\d+):in .+$/, '\1')
    )
  end
end

def initialize(shared_group_name, inclusion_location)

def initialize(shared_group_name, inclusion_location)
  @shared_group_name  = shared_group_name
  @inclusion_location = inclusion_location
end