Class: RSpec::Core::SharedExampleGroupInclusionStackFrame

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/example_group.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#inclusion_locationString (readonly)

Returns the location where the shared example was included.

Returns:

  • (String)

    the location where the shared example was included

786
787
788
# File 'lib/rspec/core/example_group.rb', line 786
def inclusion_location
  @inclusion_location
end

#shared_group_nameString (readonly)

Returns the name of the shared example group.

Returns:

  • (String)

    the name of the shared example group

784
785
786
# File 'lib/rspec/core/example_group.rb', line 784
def shared_group_name
  @shared_group_name
end

Instance Method Details

#descriptionString

Returns Description of this stack frame, in the form used by RSpec's built-in formatters.

Returns:

  • (String)

    Description of this stack frame, in the form used by RSpec's built-in formatters.

805
806
807
808
# File 'lib/rspec/core/example_group.rb', line 805
def description
  @description ||= "Shared Example Group: #{shared_group_name.inspect} " \
    "called from #{formatted_inclusion_location}"
end

#formatted_inclusion_locationString

Returns The #inclusion_location, formatted for display by a formatter.

Returns:

795
796
797
798
799
800
801
# File 'lib/rspec/core/example_group.rb', line 795
def formatted_inclusion_location
  @formatted_inclusion_location ||= begin
    RSpec.configuration.backtrace_formatter.backtrace_line(
      inclusion_location.sub(/(:\d+):in .+$/, '\1')
    )
  end
end