mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
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:
parent
1a360cff8b
commit
29b4fbebe4
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue