Class: AppMap::RSpec::ScopeExampleGroup
- Inherits:
-
Struct
- Object
- Struct
- AppMap::RSpec::ScopeExampleGroup
show all
- Includes:
- FeatureAnnotations
- Defined in:
- lib/appmap/rspec.rb
Overview
As you can see here, the way that RSpec stores the example description and represents the example group hierarchy is pretty weird.
Instance Attribute Summary collapse
Instance Method Summary
collapse
#annotations, #feature, #feature_group, #labels
Instance Attribute Details
#example_group ⇒ Object
Also known as:
example_obj
Returns the value of attribute example_group
85
86
87
|
# File 'lib/appmap/rspec.rb', line 85
def example_group
@example_group
end
|
Instance Method Details
#description ⇒ Object
103
104
105
|
# File 'lib/appmap/rspec.rb', line 103
def description
description? ? description_args.join(' ') : nil
end
|
#description? ⇒ Boolean
95
96
97
98
99
100
101
|
# File 'lib/appmap/rspec.rb', line 95
def description?
return true if example_group.respond_to?(:described_class) && example_group.described_class
return true if example_group.respond_to?(:description) && !description_args.empty?
false
end
|
#description_args ⇒ Object
90
91
92
93
|
# File 'lib/appmap/rspec.rb', line 90
def description_args
example_group.metadata[:description_args].reject { |arg| arg.is_a?(Hash) }
end
|
#parent ⇒ Object
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
# File 'lib/appmap/rspec.rb', line 107
def parent
example_group_parent = \
if example_group.respond_to?(:module_parent)
example_group.module_parent
else
example_group.parent
end
example_group_parent != example_group ? ScopeExampleGroup.new(example_group_parent) : nil
end
|