Refactor to condense lines in spec test for readability

This commit is contained in:
Garrett Honeycutt 2013-10-17 16:55:14 -04:00
parent 3ddacee430
commit ebe04a0fe6

View File

@ -31,9 +31,7 @@ describe 'ssh' do
}) })
} }
it { it { should contain_file('ssh_config').with_content(/^# This file is being maintained by Puppet.\n# DO NOT EDIT\n\n# \$OpenBSD: ssh_config,v 1.21 2005\/12\/06 22:38:27 reyk Exp \$/) }
should contain_file('ssh_config').with_content(/^# This file is being maintained by Puppet.\n# DO NOT EDIT\n\n# \$OpenBSD: ssh_config,v 1.21 2005\/12\/06 22:38:27 reyk Exp \$/)
}
it { should_not contain_file('ssh_config').with_content(/^\s*ForwardAgent$/) } it { should_not contain_file('ssh_config').with_content(/^\s*ForwardAgent$/) }
it { should_not contain_file('ssh_config').with_content(/^\s*ForwardX11$/) } it { should_not contain_file('ssh_config').with_content(/^\s*ForwardX11$/) }
@ -50,41 +48,14 @@ describe 'ssh' do
}) })
} }
it { it { should contain_file('sshd_config').with_content(/^SyslogFacility AUTH$/) }
should contain_file('sshd_config').with_content(/^SyslogFacility AUTH$/) it { should contain_file('sshd_config').with_content(/^LoginGraceTime 120$/) }
} it { should contain_file('sshd_config').with_content(/^PermitRootLogin no$/) }
it { should contain_file('sshd_config').with_content(/^ChallengeResponseAuthentication no$/) }
it { it { should contain_file('sshd_config').with_content(/^PrintMotd yes$/) }
should contain_file('sshd_config').with_content(/^LoginGraceTime 120$/) it { should contain_file('sshd_config').with_content(/^UseDNS yes$/) }
} it { should contain_file('sshd_config').with_content(/^XAuthLocation \/usr\/bin\/xauth$/) }
it { should contain_file('sshd_config').with_content(/^Subsystem sftp \/usr\/libexec\/openssh\/sftp-server$/) }
it {
should contain_file('sshd_config').with_content(/^PermitRootLogin no$/)
}
it {
should contain_file('sshd_config').with_content(/^ChallengeResponseAuthentication no$/)
}
it {
should contain_file('sshd_config').with_content(/^PrintMotd yes$/)
}
it {
should contain_file('sshd_config').with_content(/^UseDNS yes$/)
}
it {
should contain_file('sshd_config').with_content(/^Banner none$/)
}
it {
should contain_file('sshd_config').with_content(/^XAuthLocation \/usr\/bin\/xauth$/)
}
it {
should contain_file('sshd_config').with_content(/^Subsystem sftp \/usr\/libexec\/openssh\/sftp-server$/)
}
it { it {
should contain_service('sshd_service').with({ should contain_service('sshd_service').with({
@ -237,6 +208,7 @@ describe 'ssh' do
'user' => 'root', 'user' => 'root',
} }
} } } } } }
it { it {
should contain_ssh_authorized_key('root_for_userX').with({ should contain_ssh_authorized_key('root_for_userX').with({
'ensure' => 'present', 'ensure' => 'present',