summaryrefslogtreecommitdiffstats
path: root/spec/shared_behaviours
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of Util::Cacher in FileServing::ConfigurationNick Lewis2011-08-191-1/+1
| | | | | | | | | | This class was using Util::Cacher for its singleton instance, when that was unnecessary. The FileServing::Configuration instance already manages whether or not to reparse its config file, based on whether it has changed. Thus, there is no need for it to be manually expired via the cacher. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 4bad729f56c26d8154cd0f20614fa4e478de9d40)
* maint: remove inaccurate copyright and license statements.Daniel Pittman2011-08-183-12/+0
| | | | | | | | | | | For a while Luke, and other authors, injected a created tag, copyright statement, and "All rights reserved" into every new file they added to the Puppet project. This isn't really true, and we have a global license covering the code, so we have now stripped out all those old tags. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* (#6787) Add `default_to` for options.Daniel Pittman2011-07-201-0/+113
| | | | | | | | This implement support for options with default values, allowing faces to set those values when not invoked. This can eliminate substantial duplicate code from actions, especially when there are face-level options in use. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* (#7699) Help command should only list options onceDan Bode2011-07-131-1/+1
| | | | | | | | The problem was caused by the fact that the options method returns a list of options that treated the aliases as seperate options. The fix is to only maintain a list of options and not add all aliases to the options list.
* (#8048) Gem install puppet no longer fails if rdoc enabled.Josh Cooper2011-06-221-2/+1
| | | | | | | | | | Pre-released versions of faces may have used the "desc" option, which was later changed to "description", and an alias provided for "desc". The previous fix for 8048 removed this backwards compatibility (since it was never released to customers). This commit fixes the test case that assumed the "desc" option was still available. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* Maint: Fix ellipses for short descriptionsnfagerlund2011-05-261-2/+9
| | | | | | | | | | | Previously, we were adding ellipsis to any short_description, which was misleading; they were only necessary when we were truncating in the _middle_ of a paragraph. This commit changes the behavior, and updates the tests to show when we expect ellipsis. Paired-with: Matt Robinson <matt@puppetlabs.com>
* (#7279) Adding some basic file actionsLuke Kanies2011-05-031-0/+6
| | | | | | | | | | | | | | Add the ability to download a file into the local filebucket using a puppet URI or from disk. Also, the ability to store into the filebucket. These provide at least basic UI for moving data around using the filebucket service, and act as an example of how further work can be done. Also, update the code to eliminate a couple of redundant checks on arguments, and add some basic testing around the actions. Mostly only that they exist, at this point. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* Merge branch 'bug/2.7.x/7221-whitespace-stripping-for-documentation' into 2.7.xDaniel Pittman2011-04-291-14/+53
|\
| * (#7221) Strip bad whitespace from face and action docs.Daniel Pittman2011-04-291-14/+53
| | | | | | | | | | | | | | | | | | | | | | | | We now strip whitespace in face (and related) documentation in two places: We strip any trailing whitespace on each line, just because. We strip any leading indent, but not all leading whitespace, from the text. That is, we strip the *minimum* amount of whitespace that we can take from every line in the documentation without changing the overall content. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* | Merge branch 'tickets/2.7.x/7289' into 2.7.xPieter van de Bruggen2011-04-291-2/+5
|\ \ | |/ |/|
| * (#7289) Specify order for option decorations.Pieter van de Bruggen2011-04-291-2/+5
| | | | | | | | | | | | | | | | | | | | `before_action` decorations should always resolve in resolution order from most general (inherited from furthest away) to most specific (declared on the instance), and should always execute Face-level option decorations before action-level option decorations. `after_action` decorations should execute in the opposite order. Reviewed-By: Daniel Pittman
* | (#6962) Finish documentation API on Face options.Daniel Pittman2011-04-271-0/+2
| | | | | | | | | | | | | | This extends the last of the documentation support, down into options, so they can be described as expected. In the process we split out the modular docs API into a full and short version options only want short docs, but the behaviours are identical to the full version.
* | (#6962) Move documentation support into a module.Daniel Pittman2011-04-261-5/+44
| | | | | | | | | | | | Given that we have identical documentation behaviour in the face and action code, it should properly be written once. So, move it into a module, extend the other classes with it, and have done.
* | (#6962) Extend documentation API for Faces.Daniel Pittman2011-04-261-20/+163
|/ | | | | | This adds the remaining documentation mechanisms to the Face instances, allowing them to build and report correct documentation, licensing and ownership for the help face to build on.
* maint: mangle grammer in rspec to avoid Jenkins fail...Daniel Pittman2011-04-191-2/+2
| | | | | | | | Apparently 'expect { ... } .not_to' is considered unnecessary contortion by the rspec authors, so we only have 'expect { ... } .to_not' in some versions of rspec. This updates the test code to reflect that bit of annoyance.
* Merge branch 'bug/2.7.x/7132-a-summary-with-a-newline-is-accepted' into 2.7.xDaniel Pittman2011-04-191-0/+35
|\
| * (#6962) Add 'description' to faces and action.Daniel Pittman2011-04-191-0/+35
| | | | | | | | | | | | | | This adds the 'description' method to the faces and actions, as well as structured testing to ensure that the DSL works as expected. Reviewed-By: Max Martin <max@puppetlabs.com>
* | (#7131) Remove support for optional arguments to optionsMax Martin2011-04-181-25/+29
|/ | | | | | | | | As per the design decision documented in #7131, optional arguments to options will no longer be supported. This patch causes such optional arguments to raise an error, and tests for this behavior. Also cleaned up some confusing use of the term "subject" in specs. Paired-with: Daniel Pittman
* (#6830) Fix UTF-8 encoding issue for Ruby 1.9Matt Robinson2011-04-131-0/+1
| | | | | | | If you're going to use special characters in a file and use Ruby 1.9 you need to specify the character encoding at the top of the file. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* maint: ensure we handle '-foo=' options correctly in faces.Daniel Pittman2011-04-131-1/+7
| | | | | | | | | | | This is legal, and defines an option with an argument for optparse; we want to make sure that we stay consistent with that in our code handling the same sort of inputs. This also adds a framework for later testing any other strange naming bits and bobs we find around option handling. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-136-2/+2
| | | | | | | 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.
* Merge puppet-interfaces into puppet.Daniel Pittman2011-04-071-0/+134
|\ | | | | | | | | 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.
| * (#6749) detect duplicate aliases in a single option statement.Daniel Pittman2011-04-041-0/+14
| | | | | | | | | | | | | | | | | | | | This ensures that an option declaration that shadows itself is found, and reported to the user, rather than silently eating one of the two. This could have actually lost, for example, the distinction between an argument-requiring and an argument-missing variant of the same thing. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * (#6749) implementing option handling in CLI string wrapperDaniel Pittman2011-04-041-0/+120
| | | | | | | | | | | | | | | | | The purpose of this is to adapt the generic option support in our strings to the command line; we adapt the generic option information to optparse, and establish our environment early in the process to ensure that we can play nice with Puppet::Application for the moment. In the process we ensure that we detect, and report, conflicts in option naming across the board. Additionally, when an option is declared with multiple aliases, we insist that either all, or none, of them take an argument. To support this we support introspecting options having an optional argument, as well as documentation and all. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* Merge branch '2.6.next' into nextMax Martin2011-03-231-0/+185
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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) Add consistent path validation and behaviorDaniel Pittman2011-03-151-0/+185
| | | | | | | | | | | | | | | | Many path parameters were implementing their own inconsistent validation and behavior. Now those parameters can have a parent class that makes things a lot more consistent. Reviewed-by: Matt Robinson and Max Martin
* | (#6582) eliminate fakeparsefile helper method.Daniel Pittman2011-03-031-0/+21
| | | | | | | | | | | | | | | | 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>
* | Merge branch '2.6.x' into nextNick Lewis2011-01-063-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Rakefile lib/puppet/resource/type_collection.rb lib/puppet/simple_graph.rb lib/puppet/transaction.rb lib/puppet/transaction/report.rb lib/puppet/util/metric.rb spec/integration/indirector/report/rest_spec.rb spec/spec_specs/runnable_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector_spec.rb spec/unit/transaction/change_spec.rb
| * (#5771) Upgrade rspec to version 2Matt Robinson2011-01-043-3/+3
| | | | | | | | | | | | | | | | | | The biggest change is that we no longer need to monkey patch rspec to get confine behavior. Describe blocks can now be conditional like confine used to be. "describe" blocks with "shared => true" are now "shared_examples_for". Paired-With: Nick Lewis
* | Maint: Refactor tests to use <class>.indirection.<method>Paul Berry2010-11-291-7/+7
|/ | | | | | Replaced uses of the find, search, destroy, and expire methods on model classes with direct calls to the indirection objects. This change affects tests only.
* Fix for #4489 -- apply was using the rest terminusMarkus Roberts2010-08-241-1/+12
| | | | | | | | | | Basing pervasive low-level behaviour changes on the application name isn't a good idea, but if we're going to do it we need to remember to update the test when we rename the application. I am not certain that this change is globally correct; there may be other related problems that will not be fixed (and may in fact be exacerbated) by this patch.
* Code smell: Two space indentationMarkus Roberts2010-07-093-103/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 2875 spurious test failure in spec/integration/file_serving/content.rbJesse Wolfe2009-12-151-1/+1
| | | | | | Any test calling it_should_behave_like "Puppet::FileServing::Files" potentially was affected by this bug, as its stubbing was not sufficient if anything needs to be autoloaded.
* Adding pluginsyncing support to the IndirectorLuke Kanies2009-02-192-4/+5
| | | | | | | | | This switches away from the use of terminii for each type of fileserving - it goes back to the traditional fileserving method, and is much cleaner and simpler as a result. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #1834 part1 - Fix tempfile failing testsBrice Figureau2008-12-201-1/+2
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Changing the Cacher.invalidate method to Cacher.expire.Luke Kanies2008-11-111-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding automatic attribute collection to the new fileserving code.Luke Kanies2008-08-261-9/+11
| | | | | | | | | | | Basically, this just includes a consistent method for collecting info (either content or metadata) and then calls that method when returning instances via the indirector. It's such a large commit mostly because of small changes in the normal code and large changes in the testing to accomodate those small changes. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the last vestiges of the 'puppetmounts' protocol marker.Luke Kanies2008-08-261-1/+1
| | | | | | | I created this when I first designed the fileserving Indirection hooks, and it's unnecessary. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the yaml conversion code from FileContent.Luke Kanies2008-08-261-14/+9
| | | | | | | | Also fixing some integration tests that were failing because of the change to the terminus selection code for file serving. Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x' into mergingLuke Kanies2008-07-292-7/+19
|\ | | | | | | | | | | Conflicts: test/ral/type/filesources.rb
| * Fixed all of the fileserving termini so they use indirection requests.Luke Kanies2008-07-182-7/+19
| | | | | | | | | | | | | | | | This looks like a much larger commit than it is -- it doesn't change any behaviour at all, it just adds some integration tests (which expose the problem) and then switches from an ad-hoc api to a request-based api. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Using the new Cacher class for handling cached data.Luke Kanies2008-05-131-1/+1
|/ | | | | This provides a single, global bit for determining whether a given piece of cached data is still valid.
* Intermediate commit.Luke Kanies2008-04-082-6/+38
| | | | | | | | | | | | | | | | | This commit adds a Request instance into the indirection, pushing it all the way to the terminus instances. It's a big commit because it requires modifying every terminus class. There are still some thorny design issues. In particular, who should be responsible for making the request object? I've tried having both the indirection class and the Indirector module creating it, and both have their issues. Also, the Catalog class previously allowed passing Node instances directly to the find method, which is now no longer possible because the Request class would treat the node as the instance being found. We need the request class to have two modes, one when it's passed an instance and one when it's passed a key.
* Copying over Rick's work from the master branch supporting autotest andLuke Kanies2008-02-122-0/+94
cleaning up the rspec support.