Rewrite for testability

Testing the methods inside of the function is a complete pain.  This
moves the code out to use the PuppetX pattern and adds some basic unit
tests that validate the logic.
This commit is contained in:
Zach Leslie
2015-05-19 14:42:18 -07:00
parent f0e5e6e8a0
commit cb15ae8e70
9 changed files with 243 additions and 66 deletions

4
spec/fixtures/entries_multivalue.obj vendored Normal file
View File

@@ -0,0 +1,4 @@
[Iu:Net::LDAP::Entry<01>dn: uid=zach,ou=users,dc=puppetlabs,dc=com
sshpublickey:: c3NoLXJzYSBBQUFBQi4uLjE9PSB1c2VyQHNvbWV3aGVyZQo=
sshpublickey:: c3NoLXJzYSBBQUFBQi4uLjI9PSB1c2VyQHNvbWV3aGVyZWVsc2UK
:ET

8
spec/fixtures/entries_objectClass.obj vendored Normal file
View File

@@ -0,0 +1,8 @@
[Iu:Net::LDAP::Entry<01>dn: uid=zach,ou=users,dc=puppetlabs,dc=com
objectclass: posixAccount
objectclass: shadowAccount
objectclass: inetOrgPerson
objectclass: puppetPerson
objectclass: ldapPublicKey
objectclass: top
:ET

3
spec/fixtures/entries_single.obj vendored Normal file
View File

@@ -0,0 +1,3 @@
[Iu:Net::LDAP::Entry:dn: uid=zach,ou=users,dc=puppetlabs,dc=com
uid: zach
:ET