Update the inspec support check to warn to stderr. (#2446)

Signed-off-by: Jared Quick <jquick@chef.io>
This commit is contained in:
Jared Quick 2018-01-05 15:17:37 -05:00 committed by Christoph Hartmann
parent cd978deb38
commit 04859ee01d
2 changed files with 2 additions and 2 deletions

View file

@ -56,7 +56,7 @@ module Inspec
def inspec_requirement
inspec_in_supports = params[:supports].find { |x| !x[:inspec].nil? }
if inspec_in_supports
Inspec::Log.warn '[DEPRECATED] The use of inspec.yml `supports:inspec` is deprecated and will be removed in InSpec 2.0. Please use `inspec_version` instead.'
warn '[DEPRECATED] The use of inspec.yml `supports:inspec` is deprecated and will be removed in InSpec 2.0. Please use `inspec_version` instead.'
Gem::Requirement.create(inspec_in_supports[:inspec])
else
# using Gem::Requirement here to allow nil values which

View file

@ -42,7 +42,7 @@ describe 'example inheritance profile' do
File.exist?(File.join(dir, 'inspec.lock')).must_equal true
out = inspec('exec ' + dir + ' -l debug --no-create-lockfile')
out.stderr.must_equal ''
out.stderr.must_equal "[DEPRECATED] The use of inspec.yml `supports:inspec` is deprecated and will be removed in InSpec 2.0. Please use `inspec_version` instead.\n"
out.stdout.must_include 'Using cached dependency for {:url=>"https://github.com/dev-sec/ssh-baseline/archive/master.tar.gz"'
out.stdout.must_include 'Using cached dependency for {:url=>"https://github.com/dev-sec/ssl-baseline/archive/master.tar.gz"'
out.stdout.must_include 'Using cached dependency for {:url=>"https://github.com/chris-rock/windows-patch-benchmark/archive/master.tar.gz"'