mirror of
https://github.com/inspec/inspec
synced 2024-11-11 07:34:15 +00:00
Merge pull request #4043 from inspec/ap/no-resource-capitalize
Wrap resources in backticks and remove resource name capitalizing
This commit is contained in:
commit
bf28482350
6 changed files with 9 additions and 9 deletions
|
@ -173,12 +173,12 @@ module Inspec
|
|||
|
||||
unless profile_context_owner.profile_supports_platform?
|
||||
platform = inspec.platform
|
||||
msg = "Profile #{profile_context_owner.profile_id} is not supported on platform #{platform.name}/#{platform.release}."
|
||||
msg = "Profile `#{profile_context_owner.profile_id}` is not supported on platform #{platform.name}/#{platform.release}."
|
||||
::Inspec::Rule.set_skip_rule(control, true, msg)
|
||||
end
|
||||
|
||||
unless profile_context_owner.profile_supports_inspec_version?
|
||||
msg = "Profile #{profile_context_owner.profile_id} is not supported on InSpec version (#{Inspec::VERSION})."
|
||||
msg = "Profile `#{profile_context_owner.profile_id}` is not supported on InSpec version (#{Inspec::VERSION})."
|
||||
::Inspec::Rule.set_skip_rule(control, true, msg)
|
||||
end
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ module Inspec
|
|||
|
||||
def check_supports
|
||||
status = inspec.platform.supported?(@supports)
|
||||
fail_msg = "Resource #{@__resource_name__.capitalize} is not supported on platform #{inspec.platform.name}/#{inspec.platform.release}."
|
||||
fail_msg = "Resource `#{@__resource_name__}` is not supported on platform #{inspec.platform.name}/#{inspec.platform.release}."
|
||||
fail_resource(fail_msg) unless status
|
||||
status
|
||||
end
|
||||
|
|
|
@ -215,9 +215,9 @@ Test Summary: 0 successful, 0 failures, 0 skipped
|
|||
let(:out) { inspec('exec ' + File.join(profile_path, 'aws-profile')) }
|
||||
let(:stdout) { out.stdout.force_encoding(Encoding::UTF_8) }
|
||||
it 'exits with an error' do
|
||||
stdout.must_include 'Resource Aws_iam_users is not supported on platform'
|
||||
stdout.must_include 'Resource Aws_iam_access_keys is not supported on platform'
|
||||
stdout.must_include 'Resource Aws_s3_bucket is not supported on platform'
|
||||
stdout.must_include 'Resource `aws_iam_users` is not supported on platform'
|
||||
stdout.must_include 'Resource `aws_iam_access_keys` is not supported on platform'
|
||||
stdout.must_include 'Resource `aws_s3_bucket` is not supported on platform'
|
||||
stdout.must_include '3 failures'
|
||||
out.exit_status.must_equal 100
|
||||
end
|
||||
|
|
|
@ -159,7 +159,7 @@ describe 'Inspec::Resources::Crontab' do
|
|||
resource = MockLoader.new(:windows).load_resource('crontab', { user: 'special' })
|
||||
_(resource.resource_failed?).must_equal true
|
||||
_(resource.resource_exception_message)
|
||||
.must_equal 'Resource Crontab is not supported on platform windows/6.2.9200.'
|
||||
.must_equal 'Resource `crontab` is not supported on platform windows/6.2.9200.'
|
||||
end
|
||||
|
||||
it 'raises error when no user or path supplied' do
|
||||
|
|
|
@ -152,7 +152,7 @@ describe 'Inspec::Resources::Shadow' do
|
|||
resource = MockLoader.new(:windows).load_resource('shadow')
|
||||
_(resource.resource_failed?).must_equal true
|
||||
_(resource.resource_exception_message)
|
||||
.must_equal 'Resource Shadow is not supported on platform windows/6.2.9200.'
|
||||
.must_equal 'Resource `shadow` is not supported on platform windows/6.2.9200.'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,6 +26,6 @@ describe 'Inspec::Resources::WMI' do
|
|||
resource = MockLoader.new(:ubuntu1404).load_resource('wmi', {class: 'win32_service', filter: "name like '%winrm%'" })
|
||||
_(resource.resource_failed?).must_equal true
|
||||
_(resource.resource_exception_message)
|
||||
.must_equal 'Resource Wmi is not supported on platform ubuntu/14.04.'
|
||||
.must_equal 'Resource `wmi` is not supported on platform ubuntu/14.04.'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue