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:
Ryan Davis 2019-12-31 14:45:19 -08:00
parent ae0dead7be
commit cea752a01d
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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
#=============================================================================#