Class: Lazylead::RecordsLink

Inherits:
Records show all
Defined in:
lib/lazylead/task/accuracy/records_link.rb

Overview

Check that ticket has links to video record(s) with reproducing results.

Instance Attribute Summary

Attributes inherited from Requirement

#desc, #field, #score

Instance Method Summary collapse

Methods inherited from Records

#matches?

Methods inherited from Attachment

#matches?

Methods inherited from Requirement

#blank?, #non_blank?

Constructor Details

#initialize(*urls) ⇒ RecordsLink

Returns a new instance of RecordsLink.



30
31
32
33
# File 'lib/lazylead/task/accuracy/records_link.rb', line 30

def initialize(*urls)
  super([])
  @urls = urls
end

Instance Method Details

#link?(issue) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
42
43
44
45
46
47
# File 'lib/lazylead/task/accuracy/records_link.rb', line 39

def link?(issue)
  return false if issue.description.nil?
  issue.description
       .split("\n")
       .reject(&:blank?)
       .flat_map(&:split)
       .reject(&:blank?)
       .any? { |word| @urls.any? { |u| word.start_with? u } }
end

#passed(issue) ⇒ Object



35
36
37
# File 'lib/lazylead/task/accuracy/records_link.rb', line 35

def passed(issue)
  link?(issue) || super(issue)
end