mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
d0bc085412
When running InSpec with multiple profiles, and two or more of the profiles are read in using the "Flat" SourceReader (i.e. they are not actual profiles with a metadata file like inspec.yml, but rather just a folder containing .rb files with controls and tests in them), InSpec would throw a NilClass error when building the necessary objects for the formatter. The cause was in `#profile_contains_example` in the formatter code which checks to see if the profile name is the same as the profile_id in the given example. However, if both of those were nil, it would potentially match the wrong Flat-read profile. This change fixes this in two ways: refusing to match if the profile name or example profile ID is nil, and adding a default name to a profile if it doesn't have a title or name. This will solve the matching issue and also clean up the formatter output so users can more easily tell what tests are from which profile/path. Signed-off-by: Adam Leff <adam@leff.co> |
||
---|---|---|
.. | ||
control_eval_context_test.rb | ||
library_eval_context_test.rb | ||
metadata_test.rb | ||
profile_context_test.rb | ||
profile_test.rb |