inspec/test/unit/profiles
Adam Leff d0bc085412 Generate default profile names, fix bug when using two-or-more flat profiles
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>
2017-02-13 13:07:41 -05:00
..
control_eval_context_test.rb control and lib eval unit tests 2017-01-04 11:33:14 -05:00
library_eval_context_test.rb control and lib eval unit tests 2017-01-04 11:33:14 -05:00
metadata_test.rb Generate default profile names, fix bug when using two-or-more flat profiles 2017-02-13 13:07:41 -05:00
profile_context_test.rb Remove some warnings during the test run 2016-09-09 14:14:36 +01:00
profile_test.rb Generate default profile names, fix bug when using two-or-more flat profiles 2017-02-13 13:07:41 -05:00