Class: Gitlab::Dangerfiles::Capability::Test

Inherits:
Gitlab::Dangerfiles::Capability show all
Defined in:
lib/gitlab/dangerfiles/capability.rb

Instance Attribute Summary

Attributes inherited from Gitlab::Dangerfiles::CapabilityStruct

#category, #kind, #labels, #project

Instance Method Summary collapse

Methods inherited from Gitlab::Dangerfiles::Capability

for

Instance Method Details

#has_capability?(teammate) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
45
46
47
48
# File 'lib/gitlab/dangerfiles/capability.rb', line 42

def has_capability?(teammate)
  return false if kind != :reviewer

  area = teammate.role[/Software Engineer in Test(?:.*?, (\w+))/, 1]

  !!area && labels.any?("devops::#{area.downcase}")
end