From f7b01093a4a905d45f4e906a4450dc6faa923a37 Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Tue, 23 Apr 2019 11:45:42 -0400 Subject: [PATCH] Warn on using default with attributes Signed-off-by: Clinton Wolfe --- etc/deprecations.json | 2 +- test/functional/inspec_check_test.rb | 2 +- test/functional/inspec_vendor_test.rb | 4 +++- test/unit/mock/profiles/inputs/metadata-invalid/inspec.yml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/etc/deprecations.json b/etc/deprecations.json index c38076f8f..1dea5a409 100644 --- a/etc/deprecations.json +++ b/etc/deprecations.json @@ -3,7 +3,7 @@ "unknown_group_action": "ignore", "groups": { "attrs_value_replaces_default": { - "action": "ignore", + "action": "warn", "prefix": "The 'default' option for attributes is being replaced by 'value' - please use it instead." }, "aws_resources_in_resource_pack": { diff --git a/test/functional/inspec_check_test.rb b/test/functional/inspec_check_test.rb index 1a3d14f04..c77ca8875 100644 --- a/test/functional/inspec_check_test.rb +++ b/test/functional/inspec_check_test.rb @@ -11,7 +11,7 @@ describe 'inspec check' do 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 = inspec('check ' + example_profile + ' --format json') out.exit_status.must_equal 0 JSON.parse(out.stdout) end diff --git a/test/functional/inspec_vendor_test.rb b/test/functional/inspec_vendor_test.rb index 92275981b..8ab8f1994 100644 --- a/test/functional/inspec_vendor_test.rb +++ b/test/functional/inspec_vendor_test.rb @@ -107,7 +107,9 @@ describe 'example inheritance profile' do out.exit_status.must_equal 0 out = inspec('json ' + dir + ' --output ' + dst.path) - out.stderr.must_equal '' + + # the profile used has 'default' style attributes + out.stderr_ignore_deprecations.must_equal '' out.exit_status.must_equal 0 hm = JSON.load(File.read(dst.path)) diff --git a/test/unit/mock/profiles/inputs/metadata-invalid/inspec.yml b/test/unit/mock/profiles/inputs/metadata-invalid/inspec.yml index d700d909c..235642cf4 100644 --- a/test/unit/mock/profiles/inputs/metadata-invalid/inspec.yml +++ b/test/unit/mock/profiles/inputs/metadata-invalid/inspec.yml @@ -9,4 +9,4 @@ version: 0.1.0 attributes: - name: val_color type: color - default: black + value: black