6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/probe_dock_rspec/meta_parser.rb', line 6
def self.parse example, groups = []
options = {}
%i(key category tags tickets data active).each do |attr|
options[attr] = send("extract_#{attr}", example, groups)
end
name_parts = (example, groups)
options[:name] = name_parts.join(' ')
options[:fingerprint] = Digest::SHA1.hexdigest(name_parts.join('|||'))
data = options[:data]
metadata = example.metadata
data['fingerprint'] = options[:fingerprint]
data['file.path'] = metadata[:file_path].to_s.sub(/^\.\//, '') if metadata[:file_path]
data['file.line'] = metadata[:line_number] if metadata[:line_number]
options
end
|