Class: RSpec::Core::SharedExampleGroupInclusionStackFrame
- Inherits:
-
Object
- Object
- RSpec::Core::SharedExampleGroupInclusionStackFrame
- Defined in:
- lib/rspec/core/example_group.rb
Overview
Contains information about the inclusion site of a shared example group.
Instance Attribute Summary (collapse)
-
- (String) inclusion_location
readonly
The location where the shared example was included.
-
- (String) shared_group_name
readonly
The name of the shared example group.
Instance Method Summary (collapse)
-
- (String) description
Description of this stack frame, in the form used by RSpec's built-in formatters.
-
- (String) formatted_inclusion_location
The #inclusion_location, formatted for display by a formatter.
-
- (SharedExampleGroupInclusionStackFrame) initialize(shared_group_name, inclusion_location)
constructor
A new instance of SharedExampleGroupInclusionStackFrame.
Constructor Details
- (SharedExampleGroupInclusionStackFrame) initialize(shared_group_name, inclusion_location)
Returns a new instance of SharedExampleGroupInclusionStackFrame
710 711 712 713 |
# File 'lib/rspec/core/example_group.rb', line 710 def initialize(shared_group_name, inclusion_location) @shared_group_name = shared_group_name @inclusion_location = inclusion_location end |
Instance Attribute Details
- (String) inclusion_location (readonly)
Returns the location where the shared example was included
708 709 710 |
# File 'lib/rspec/core/example_group.rb', line 708 def inclusion_location @inclusion_location end |
- (String) shared_group_name (readonly)
Returns the name of the shared example group
706 707 708 |
# File 'lib/rspec/core/example_group.rb', line 706 def shared_group_name @shared_group_name end |
Instance Method Details
- (String) description
Returns Description of this stack frame, in the form used by RSpec's built-in formatters.
726 727 728 729 |
# File 'lib/rspec/core/example_group.rb', line 726 def description @description ||= "Shared Example Group: #{shared_group_name.inspect} " \ "called from #{formatted_inclusion_location}" end |
- (String) formatted_inclusion_location
Returns The #inclusion_location, formatted for display by a formatter.
716 717 718 719 720 721 722 |
# File 'lib/rspec/core/example_group.rb', line 716 def formatted_inclusion_location @formatted_inclusion_location ||= begin RSpec.configuration.backtrace_formatter.backtrace_line( inclusion_location.sub(/(:\d+):in .+$/, '\1') ) end end |