inspec/test/functional/inspec_check_test.rb
Jerry Aldrich III 125e0915b2 Modify DirProvider to allow special characters (#2174)
This modifies `Inspec::DirProvider` to allow special characters in the
file glob by escaping those characters via `Shellwords.shellescape`.

This fixes #2111 (`inspec check` on path with special characters)

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-09-23 09:16:25 +02:00

25 lines
691 B
Ruby

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann
require 'functional/helper'
require 'jsonschema'
describe 'inspec check' do
include FunctionalHelper
describe 'inspec check with json formatter' do
it 'can check a profile and produce valid JSON' do
out = inspec('check ' + integration_test_path + ' --format json')
out.exit_status.must_equal 0
JSON.parse(out.stdout)
end
end
describe 'inspec check with special characters in path' do
it 'can check a profile with special characters in its path' do
out = inspec('check ' + File.join(profile_path, '{{special-path}}'))
out.exit_status.must_equal 0
end
end
end