Attempt at a bug fix to read backslashes as forward slashes in local fetcher

This commit is contained in:
Annie Hedgpeth 2016-06-29 22:18:30 -05:00 committed by Christoph Hartmann
parent 8825b71412
commit fe5c7c49a4
2 changed files with 28 additions and 23 deletions

View file

@ -15,6 +15,9 @@ module Fetchers
# Support "urls" in the form of file://
if target.start_with?('file://')
target = target.gsub(%r{^file://}, '')
else
# support for windows paths
target.tr!('\\', '/')
end
if !File.exist?(target)

View file

@ -52,6 +52,8 @@ describe Inspec::Plugins::RelFetcher do
# ignored by all tar streaming tools, its not extracted by GNU tar since 1.14
%w{/pax_global_header /a/b} => %w{b},
%w{pax_global_header a/b} => %w{b},
# windows path
%w{.\\path\\} => %w{./path/}
}.each do |ins, outs|
describe 'empty profile' do
let(:in_files) { ins }