inspec/test/unit/profiles
Adam Leff 9580732814 Source reader should not hand back files with nil contents (#2003)
If a profile has a data files directory that looks like this:

```
files/platforms/one/data.json
files/platforms/two/data.json
files/platforms/three/data.json
```

... the source reader will return the directories in the list of files but with
nil contents. This causes an issue when Inspec::Profile tries to create a sha256
checksum of the profile contents only to try to cast nil to a string when
building the null-delimited profile contents string.

Files that are empty will have an empty string as its contents, so it's safe to
assume that file entries with nil contents are actually a directory and have no
affect on the profile's checksum. Therefore, this change will eliminate any file
entries in responses from the source readers where the contents are nil.

Signed-off-by: Adam Leff <adam@leff.co>
2017-07-11 21:33:55 +02: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 throw an error during inspec check if the version is not correct 2017-05-18 09:13:37 -04:00
profile_context_test.rb Remove some warnings during the test run 2016-09-09 14:14:36 +01:00
profile_test.rb Source reader should not hand back files with nil contents (#2003) 2017-07-11 21:33:55 +02:00