class RuboCop::RSpec::Hook

Wrapper for RSpec hook

def example?

def example?
  scope.equal?(:each)
end

def knowable_scope?

def knowable_scope?
  return true unless scope_argument
  scope_argument.sym_type?
end

def name

def name
  node.method_name
end

def scope

def scope
  case scope_name
  when nil, :each, :example then :each
  when :context, :all       then :context
  when :suite               then :suite
  else
    scope_name
  end
end

def scope_argument

def scope_argument
  node.send_node.first_argument
end

def scope_name

def scope_name
  scope_argument.to_a.first
end

def valid_scope?

def valid_scope?
  STANDARDIZED_SCOPES.include?(scope)
end