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
-
#inclusion_location ⇒ String
readonly
The location where the shared example was included.
-
#shared_group_name ⇒ String
readonly
The name of the shared example group.
Instance Method Summary collapse
-
#description ⇒ String
Description of this stack frame, in the form used by RSpec's built-in formatters.
-
#formatted_inclusion_location ⇒ String
The #inclusion_location, formatted for display by a formatter.
-
#initialize(shared_group_name, inclusion_location) ⇒ SharedExampleGroupInclusionStackFrame
constructor
A new instance of SharedExampleGroupInclusionStackFrame.
Constructor Details
#initialize(shared_group_name, inclusion_location) ⇒ SharedExampleGroupInclusionStackFrame
Returns a new instance of SharedExampleGroupInclusionStackFrame.
773 774 775 776 |
# File 'lib/rspec/core/example_group.rb', line 773 def initialize(shared_group_name, inclusion_location) @shared_group_name = shared_group_name @inclusion_location = inclusion_location end |
Instance Attribute Details
#inclusion_location ⇒ String (readonly)
Returns the location where the shared example was included.
771 772 773 |
# File 'lib/rspec/core/example_group.rb', line 771 def inclusion_location @inclusion_location end |
#shared_group_name ⇒ String (readonly)
Returns the name of the shared example group.
769 770 771 |
# File 'lib/rspec/core/example_group.rb', line 769 def shared_group_name @shared_group_name end |
Instance Method Details
#description ⇒ String
Returns Description of this stack frame, in the form used by RSpec's built-in formatters.
789 790 791 792 |
# File 'lib/rspec/core/example_group.rb', line 789 def description @description ||= "Shared Example Group: #{shared_group_name.inspect} " \ "called from #{formatted_inclusion_location}" end |
#formatted_inclusion_location ⇒ String
Returns The #inclusion_location, formatted for display by a formatter.
779 780 781 782 783 784 785 |
# File 'lib/rspec/core/example_group.rb', line 779 def formatted_inclusion_location @formatted_inclusion_location ||= begin RSpec.configuration.backtrace_formatter.backtrace_line( inclusion_location.sub(/(:\d+):in .+$/, '\1') ) end end |