summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/host
Commit message (Collapse)AuthorAgeFilesLines
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-131-2/+1
| | | | | | | We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
* maint: just require 'spec_helper', thanks rspec2Daniel Pittman2011-04-081-1/+1
| | | | | | | | | | | rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* (#6582) eliminate fakeresource use in ssh_authorized_key spec.Daniel Pittman2011-03-031-0/+1
| | | | | | | We replace it with an instance of the actual resource we are testing, which reduces the number of ways this code is tied to the specific implementation. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* (#6582) eliminate fakeparsefile helper method.Daniel Pittman2011-03-031-7/+2
| | | | | | | | This was a helper that implemented rspec style "shared behaviour" for Test::Unit; now that we have moved on we can use the upstream implementation instead. This eliminates a whole bit of code we have to maintain. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* (#6582) Eliminate the old fakedata helper method.Daniel Pittman2011-03-031-3/+1
| | | | | | | | This is replaced with the new my_fixture{,s} methods; old fixture data is ported into the spec tests at the same time, but left where it was against unit tests that require it. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* (#5427) Using Propery::OrderedList for host_aliasStefan Schulte2010-12-141-10/+18
| | | | | | | | | | | | | | | | | This uses the propertyclass Puppet::Property::OrderedList to represent the list of host_aliases. This lets us remove the in_sync, should_to_s etc overrides. In the provider class the list is represented by a string (=no array) so there were a few changes necessary as well. Because Puppet::Property::List uses the specified delimiter when converting should values to strings, I changed the delimiter to a simple space instead a tab. This keeps messages produced by puppet in a nice format. The tests had to be changed to work with the new behaviour of host_aliases. There are a few additional tests as well.
* maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-061-1/+1
| | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* (#5274) New tests for new hosttype/parsedproviderStefan Schulte2010-11-171-0/+44
| | | | | Just a few additional tests for the new property "comment" of the host type.
* (#5274) Tests for hostprovider removes commentsStefan Schulte2010-11-171-0/+152
I noticed that the hostprovider will remove all inline comments from the /etc/hosts file, when puppet updates at least one entry. Puppet will also remove comments from entries, the user doesnt want to manage with puppet. To split up changes a bit this commit will only introduce tests for the host type and the hostprovider. A few will fail, indicating the bug: The hostprovider parses all entries and builds a hash. When building the recordhash all comments are discarded. When puppet has to update at least one entry it uses the to_line function to convert the record hash back to a file. Because the comments are not stored in the hash, they cannot be written back to the file.