Fix some issues with the vendor functional tests (#3196)

* Sort `Dir.entries` in functional test

Ruby's `Dir.entries` differs between OS's. This ensures the same order
is used when comparing two arrays.

* Remove unused variable `exec_out`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This commit is contained in:
Jerry Aldrich 2018-07-05 11:19:41 -07:00 committed by Jared Quick
parent 30acc75ea5
commit a56539bc62

View file

@ -134,11 +134,12 @@ describe 'example inheritance profile' do
File.exist?(File.join(dir, 'inspec.lock')).must_equal true
File.exist?(File.join(dir, 'vendor_cache')).must_equal false
exec_out = inspec('exec ' + dir + ' --vendor-cache ' + dir + '/vendor_cache')
# Run `inspec exec` to create vendor cache
inspec('exec ' + dir + ' --vendor-cache ' + dir + '/vendor_cache')
File.exist?(File.join(dir, 'vendor_cache')).must_equal true
vendor_files = Dir.entries("#{dir}/vendor/")
vendor_cache_files = Dir.entries("#{dir}/vendor_cache/")
vendor_files = Dir.entries("#{dir}/vendor/").sort
vendor_cache_files = Dir.entries("#{dir}/vendor_cache/").sort
vendor_files.must_equal vendor_cache_files
end
end