inspec/test/unit
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
..
dependencies Bump lockfile version to 1.0 2016-09-26 09:51:04 +01:00
dsl Provide a way to force it vs its for any argument 2017-02-03 19:26:02 +00:00
fetchers Change :shasum key to :sha256 for future upgrade 2016-09-21 10:51:04 +01:00
mock Adding new crontab resource 2017-02-10 09:33:31 -05:00
plugins Remove some warnings during the test run 2016-09-09 14:14:36 +01:00
profiles Generate default profile names, fix bug when using two-or-more flat profiles 2017-02-13 13:07:41 -05:00
resources Adding new crontab resource 2017-02-10 09:33:31 -05:00
source_readers Add GitFetcher and rework Fetchers+SourceReaders 2016-09-09 14:14:36 +01:00
utils bugfix: support nil entries in filter table 2016-10-05 13:04:00 +02:00
file_provider_test.rb Add GitFetcher and rework Fetchers+SourceReaders 2016-09-09 14:14:36 +01:00
shell_detector_test.rb Add inspec env command to configure shell tab-completion 2016-08-10 02:07:53 +01:00