summaryrefslogtreecommitdiffstats
path: root/spec/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge puppet-interfaces into puppet.Daniel Pittman2011-04-071-0/+4
| | | | | This joins the two repositories, including full history, into a single run, as well as landing the interfaces work on the next branch ready for release.
* Merge branch '2.6.next' into nextMax Martin2011-03-231-0/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: Fixed #6562 - Minor kick documentation fix (#6658) Propagate ENC connection errors to the agent (#4884) Remove typo from spec test (#4884) Modify tests to pass on non-OS X systems (#4884) Revise new exec tests, add a few more (#4884) Add an shell provider for execs (#4884) Fix Test::Unit exec tests (#4884) Break the exec type out to have a posix provider (#4884) Add consistent path validation and behavior (#4884) Add expand_path to requiring the spec_helper (#4884) Autorequire shared behaviors and method to silence warnings (#4884) Fix whitespace (#4884) Get rid of open3 require since it wasn't being used (#5814) Improved cron type specs (#5814) cron_spec shouldn't depend on cron provider Manually Resolved Conflicts: lib/puppet/util/command_line/puppetrun spec/spec_helper.rb spec/unit/type/exec_spec.rb spec/unit/type_spec.rb test/ral/type/exec.rb
| * (#4884) Autorequire shared behaviors and method to silence warningsDaniel Pittman2011-03-151-0/+9
| | | | | | | | | | | | | | with_verbose_disabled allows you to run tests that muck with constans without getting spammy warnings. Reviewed-by: Max Martin and Matt Robinson
* | (#6582) Don't demand the checkout be named 'puppet'.Daniel Pittman2011-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | As part of implementing the fixture support I hard-coded the assumption that the git checkout was a directory named 'puppet'; this broke on our CI server, and would break for anyone else who didn't follow that default. This commit eliminates that assumption and depends only on the appropriate part of the input filename. Reviewed-By: Paul Berry <paul@puppetlabs.com>
* | (#6582) move more helper code into methods, out of RSpec#configureDaniel Pittman2011-03-031-0/+23
| | | | | | | | | | | | | | | | We move the tempfile cleanup support off into the module that uses it, which removes some of the dependency on magic globals from configure. It still exists, but is hidden in the same module that uses it, which helps. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | (#6582) add fixture helper methods to replace unit test code.Daniel Pittman2011-03-031-0/+28
|/ | | | | | | | | | | | | We validate that fixtures exist, when requested, or that they match something when they use a glob. This catches internal errors where we don't match any fixtures with a glob; this can reveal problems that would otherwise avoid all assertions and result in internal failures. The code is hidden out in a module, included in the main RSpec namespace. This doesn't clean up the API any, but it isolates the code more effectively and keeps the configuration file cleaner. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* [#4771] Import of manifests with the same name only happens oncePaul Berry2010-09-231-0/+1
| | | | | | | | | | | | | | | The function import_if_possible, which was supposed to be responsible for making sure that no two threads tried to import the same file at the same time, was not making this decision based on the full pathname of the file, since it was being invoked before pathnames were resolved. As a result, if we attempted to import two distinct files with the same name at the same time (either in two threads or in a single thread due to recursion), one of the files would not always get imported. Fixed this problem by moving the thread-safety logic to happen after filenames are resolved to absolute paths. This made it possible to simplify the thread-safety logic significantly.
* Code smell: Two space indentationMarkus Roberts2010-07-091-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
* Adding tmpfile cleanup to testsLuke Kanies2010-02-171-0/+10
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding a Spec lib directory and moving tmpfile to itLuke Kanies2009-05-261-0/+9
| | | | | | | | | | | | | | We had a common pattern for creating a temporary file during integration tests, and this just makes that common pattern explicit by moving it to a module in the newly-created lib directory in the spec directory. We definitely don't want to go overboard in using libraries in our tests, but sometimes it gets a bit excessive to completely avoid them. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving $PUPPET/spec/lib/autotest up to $PUPPET/autotest as something has ↵Rick Bradley2007-12-0581-6087/+0
| | | | | | | | | | | | changed and it can't be found otherwise. Adding $PUPPET/vendor/gems, with unpacked rspec gem there, introducing to spec_helper.rb LOAD_PATH incantation. Eliminating ad hoc unpacked rspec from spec/lib. Moving monkey_patches and shared_behaviors up under spec/. Adjusting spec_helper.rb accordingly. Nuking spec/lib. Fixing up autotest/puppet_rspec.rb to be able to hunt down our vendor/gems/rspec/bin/spec binary. We can now run rspec without having to have the rspec gem installed.
* moving autotest directory to make it possible to run autotest againRick Bradley2007-12-053-150/+0
|
* Fixing #920 -- I have replaced the existing mount test with anLuke Kanies2007-11-261-4/+5
| | | | | rspec version. It's not perfect, in that it only tests the :ensure state, but that's where 90% of the behaviour is.
* Fixing the last failing test relating to the environment changesLuke Kanies2007-11-201-1/+2
|
* This won't be perfect by any stretch, but put in a moderately reasonable ↵Rick Bradley2007-10-261-0/+33
| | | | autotest config file.
* One significant step closer to getting autotest running properly on the ↵Rick Bradley2007-10-266-5/+147
| | | | | | | | | | | | | | | | | | | | Puppet specs. Created a spec/lib/monkey_patches/ directory for holding patches to RSpec functionality. Extraced 'confine' and 'runnable?' support from the local copy of RSpec (spec/lib/spec/) and now load them from the monkey_patches/ directory. Fixed a bad include in one of the specs. Made it possible for the gem-installed spec binary (which autotest calls) to be used with Puppet. Imported the Autotest::Rspec class, created a PuppetRspec autotest class, added a discovery.rb file for autotest to pick these up. Autotest still has the following problems: * it needs to be run with the proper include path: % ruby -I spec/lib/ `which autotest` * the patterns in our custom autotest handler (puppet_rspec) aren't yet fully specified (they only recognize changes in our spec files, not changes in the puppet libs which they are testing)
* File serving should work now, both recursive andLuke Kanies2007-10-241-2/+1
| | | | | | | | | | | | | | single files, across modules, local file system, and the traditional file server. This work revolves around making sure that the termini produce functional file instances, meaning that they know how to find their content or metadata, which largely comes down to setting their paths correctly. I also created a new terminus base class for the local filesystem, since there was so much common code between content and metadata.
* Adding the calls to the authorization hooks in the Indirection.Luke Kanies2007-10-231-0/+2
|
* Renaming the :local termini for metadata and contentLuke Kanies2007-10-221-4/+4
| | | | to :file.
* Link handling is now in the file serving classes.Luke Kanies2007-10-221-1/+1
| | | | | | | | | | This was done by putting all of the functionality in the Content and Metadata class (actually, in a new base class for them). There are still some issues, and there need to be integration tests between the :local (soon to be renamed :file) termini for these classes.
* Adding authorization hooks to the file_server andLuke Kanies2007-10-212-8/+2
| | | | | | | | | | | | | module_files indirection terminus types. Both hooks use the fileserver configuration, but the module_files hook only uses the 'modules' mount. Also moved all responsibility for knowing whether to use the 'modules' terminus type to the terminus selector; it was previously spread between that and the file_server terminus, which made some things annoyingly complicated. This normalizes the deprecation notices and the logic about how we make these decisions.
* Renaming the 'mounts' terminus to 'file_server', and renamingLuke Kanies2007-10-202-7/+5
| | | | tests accordingly.
* File serving now works. I've tested a couple of ways toLuke Kanies2007-10-191-1/+15
| | | | | | | | | | | | | | | | use it, and added integration tests at the most important hook points. This provides the final class structure for all of these classes, but a lot of the class names are pretty bad, so I'm planning on going through all of them (especially the file_server stuff) and renaming. The functionality is all here for finding files, though (finally). Once the classes are renamed, I'll be adding searching ability (which will enable the recursive file copies) and then adding the link management and enabling ignoring files.
* I've now split the file-serving termini into two separate types (inLuke Kanies2007-10-182-0/+86
| | | | | | | | | | | | | | | | addition to Rest): A local terminus that just uses direct file paths, and a mounts terminus that uses the file server to figure out what the path should be. It looks like it also makes sense to split the 'mounts' terminus further, so there is a 'modules' terminus used to look files up in the terminus. I've added some integration tests to verify that everything is hooked together correctly. Lastly, I added a directory for shared behaviours. There's a ton of duplication in this setup, because the Content and Metadata classes behave almost but not quite identically across the board.
* Updates to indirection stuffs. Making a better spec and migrating to it.Rick Bradley2007-09-171-1/+1
|
* Another intermediate commit. The node and fact classes are now functional ↵Luke Kanies2007-09-122-1/+7
| | | | and are used instead of the network handlers, which have been removed. There are some failing tests as a result, but I want to get this code committed before I massage the rest of the system to make it work again.
* Building a stand-alone spec directory for creating the new spec-based tests.Luke Kanies2007-08-2378-0/+5961