puppetlabs/puppet — pull request #1388 by stschulte (2013-01-14 23:07:26+00:00)
Title: (#11675) Fixup test failures

Pullrequest #1387 was reverted because of test failures. This is my attempt to fix these:

The spec tests for the Puppet::Type.addcmd method failed on ruby 1.8.7.

The addcmd method builds a commandline to execute `useradd` with
appropiate command line arguments. To build the commandline
`add_properties` gets called which in turn calls
`Puppet::Type.validproperties`. The order in which properties are returned
can be considered undefinied so the whole `useradd` commandline can include
arguments in random order. While the randomness does not make a difference for
the useradd executable it causes spec failures on some systems.

Sort the properties when building the useradd commandline. This way the
result is consistent across all ruby versions and easier to test.