Method: AppMap::RSpec::ScopeExampleGroup#parent

Defined in:
lib/appmap/rspec.rb

#parentObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/appmap/rspec.rb', line 58

def parent
  # An example group always has a parent; but it might be 'self'...

  # DEPRECATION WARNING: `Module#parent` has been renamed to `module_parent`. `parent` is deprecated and will be
  # removed in Rails 6.1. (called from parent at /Users/kgilpin/source/appland/appmap-ruby/lib/appmap/rspec.rb:110)
  example_group_parent = \
    if example_group.respond_to?(:module_parent)
      example_group.module_parent
    elsif example_group.respond_to?(:parent)
      example_group.parent
    elsif example_group.respond_to?(:parent_groups)
      example_group.parent_groups.first
    end

  (example_group_parent == example_group) ? nil : ScopeExampleGroup.new(example_group_parent)
end