mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Tweak for aws resources to determine if they're still under test.
Everyone now has an `inspec` method, but the AWS ones still return nil as their backend hasn't been set up. This seems wrong... Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
parent
ae0dead7be
commit
cea752a01d
3 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ module AwsResourceMixin
|
|||
end
|
||||
rescue ArgumentError => e
|
||||
# continue with ArgumentError if testing
|
||||
raise unless respond_to?(:inspec)
|
||||
raise unless respond_to?(:inspec) && inspec
|
||||
|
||||
raise Inspec::Exceptions::ResourceFailed, e.message
|
||||
end
|
||||
|
|
|
@ -28,9 +28,9 @@ describe "AwsResourceMixin" do
|
|||
raise ArgumentError, "this param is not right"
|
||||
end
|
||||
|
||||
# if inspec is defined we are a live test
|
||||
# if inspec is defined and returns true we are a live test
|
||||
def inspec
|
||||
# live
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ require "resources/aws/aws_iam_user"
|
|||
require "resource_support/aws"
|
||||
require "resources/aws/aws_iam_user"
|
||||
|
||||
# MAUIB = MockAwsIamUserBackend
|
||||
# MAIUB = MockAwsIamUserBackend
|
||||
# Abbreviation not used outside this file
|
||||
|
||||
#=============================================================================#
|
||||
|
|
Loading…
Reference in a new issue