Add to_s method to aws_iam_password_policy (#61)

* Add to_s method to aws_iam_password_policy

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* Use single quoted string and remove unnecessary substring

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
This commit is contained in:
Steffanie Freeman 2017-06-29 06:03:20 -04:00 committed by Christoph Hartmann
parent 1a360cff8b
commit 29b4fbebe4
2 changed files with 11 additions and 0 deletions

View file

@ -68,4 +68,8 @@ class AwsIamPasswordPolicy < Inspec.resource(1)
unless prevents_password_reuse?
@policy.password_reuse_prevention
end
def to_s
'IAM Password-Policy'
end
end

View file

@ -66,6 +66,13 @@ class AwsIamPasswordPolicyTest < Minitest::Test
assert_equal expectedValue, AwsIamPasswordPolicy.new(@mockConn).number_of_passwords_to_remember
end
def test_policy_to_s
configure_policy_password_reuse_prevention(value: Object.new)
expectedValue = "IAM Password-Policy"
test = AwsIamPasswordPolicy.new(@mockConn).to_s
assert_equal expectedValue, test
end
private
def configure_policy_password_reuse_prevention(value: value, n: 1)