mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
Merge pull request #543 from chef/vj/add-title-desc-code-source-loc-to-metadata
Add title, description, code, and source_location to example metadata
This commit is contained in:
commit
424d97c0b6
2 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,8 @@ module RSpec::Core::Formatters
|
|||
pending_message: example.execution_result.pending_message,
|
||||
id: example.metadata[:id],
|
||||
impact: example.metadata[:impact],
|
||||
title: example.metadata[:title],
|
||||
desc: example.metadata[:desc],
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -102,9 +102,17 @@ module Inspec
|
|||
def set_rspec_ids(example, id, rule)
|
||||
example.metadata[:id] = id
|
||||
example.metadata[:impact] = rule.impact
|
||||
example.metadata[:title] = rule.title
|
||||
example.metadata[:desc] = rule.desc
|
||||
example.metadata[:code] = rule.instance_variable_get(:@__code)
|
||||
example.metadata[:source_location] = rule.instance_variable_get(:@__source_location)
|
||||
example.filtered_examples.each do |e|
|
||||
e.metadata[:id] = id
|
||||
e.metadata[:impact] = rule.impact
|
||||
e.metadata[:title] = rule.title
|
||||
e.metadata[:desc] = rule.desc
|
||||
e.metadata[:code] = rule.instance_variable_get(:@__code)
|
||||
e.metadata[:source_location] = rule.instance_variable_get(:@__source_location)
|
||||
end
|
||||
example.children.each do |child|
|
||||
set_rspec_ids(child, id, rule)
|
||||
|
|
Loading…
Reference in a new issue