mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
125e0915b2
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>
25 lines
691 B
Ruby
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
|