summaryrefslogtreecommitdiff
path: root/spec/unit/interface/option_builder_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2013-06-25(maint) Includes missing spec_helper in three specs.Josh Partlow1-0/+1
spec/spec_helper was missing from three of the specs. This showed up because spec/unit/pops/containment_spec.rb just happened to come first in the order of specs to be executed on our Solaris build, and began causing failures because puppet/pops was being loaded prior to spec_helper and puppet. It was also causing rspec/mocha setup and teardown failures, presumably because of rspec configuration being called after this initial spec was loaded. This commit ensures that each of these specs requires spec_helper first so that spec and the puppet environment initialize properly regardless of whether these specs run first or come later in the spec ordering.
2013-03-26(Maint) Re-structure require statements to avoid loopAndrew Parker1-1/+1
The way in which the require statements for the puppet/interface module worked caused a dependency loop that could only be resolved by using the modules and classes in a very specific order. The tests showed this problem if they were run in a different order: /export/home/jenkins/workspace/Puppet Specs Solaris (master)/solaris10-i386/solaris10-i386/lib/puppet/interface/action_builder.rb:128: uninitialized constant Puppet::Interface::Action (NameError) from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /export/home/jenkins/workspace/Puppet Specs Solaris (master)/solaris10-i386/solaris10-i386/lib/puppet/interface/action_manager.rb:2 from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /export/home/jenkins/workspace/Puppet Specs Solaris (master)/solaris10-i386/solaris10-i386/lib/puppet/interface.rb:13 from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /export/home/jenkins/workspace/Puppet Specs Solaris (master)/solaris10-i386/solaris10-i386/lib/puppet/interface/action.rb:1 from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /opt/csw/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /export/home/jenkins/workspace/Puppet Specs Solaris (master)/solaris10-i386/solaris10-i386/spec/unit/interface/action_spec.rb:3 from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load' from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files' from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map' from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files' from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run' from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run' from /opt/csw/lib/ruby/gems/1.8/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `autorun' from /opt/csw/bin/rspec:19 This re-orders the requires so that only the top level module (Puppet::Interface) requires all of the components that are part of it. Paired-with: patrick@puppetlabs.com
2012-07-24Make 3.x specs compatible with rspec 2.11Patrick Carlisle1-1/+1
2012-04-17(#13898) Fail Face when option collides w/ settingJeff Weiss1-1/+9
Change Puppet::Interface::Option to prohibit options on Faces that have the same name as an existing Puppet setting. Move functionality of Puppet::Util::Setting::StringSetting.setbycli to Puppet::Util::Settings and deprecate usage of StringSetting.setbycli because StringSetting provides metadata for the definition of setting, whereas Setting contains both the value and the origin of the value, whether :cli, :memory, :application_defaults, etc. Change ca application and certificate Face to properly handle all permutations of --dns_alt_names (Puppet setting) and --dns-alt-names (Face option). Remove "documentation only" options of :modulepath and :environment from module Face. Prior to this commit, Faces could declare options that collided with existing Puppet settings, which has caused unexpected behavior for the Face. This commit explicitly prohibits the Face from declaring an option which is already a Puppet setting. This is a potentially breaking change for externally developed Faces.
2011-04-27(#6962) Finish documentation API on Face options.Daniel Pittman1-6/+8
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.
2011-04-17(#7013) Add support for required options.Pieter van de Bruggen1-0/+15
This adds another hook into the generated wrapper, which invokes a method to validate arguments. This is used to raise an exception when required options have not been passed to the method. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
2011-04-15(#6978) Enforce the calling convention of option hooks.Daniel Pittman1-4/+30
We require that hooks take exactly three arguments; now we enforce that in the DSL, to ensure we give good, and early, errors to users who do the wrong thing. Paired-With: Max Martin <max@puppetlabs.com>
2011-04-15(#6978) Add before and after decorators to actions from options.Daniel Pittman1-13/+18
Options can now add before_action and after_action blocks; these are invoked before or after any action is invoked on the face. This allows these options to declare common behaviour and have it automatically applied to the actions invoked. Option hooks have no defined order of invocation: they will run in a completely random order. Where there are dependencies they should be on the value of the options hash passed to the invocation, not on side-effects of the other invocations. You are not able to influence the arguments, options, or calling of the action body in a before or after decorator. This is by design. The invocation passes to the hook: 1. The action object representing this action. 2. The arguments to the action, as an array. 3. The options for the action, as a hash. Paired-With: Max Martin <max@puppetlabs.com>
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman1-0/+0
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.
2011-04-07(#7012) Split plumbing into Puppet::InterfaceDaniel Pittman1-0/+29
This splits out the plumbing into the Puppet::Interface namespace, and uses Puppet::Faces for all the public-facing code. The fault line is "what you care about if you are using or writing a face", which is public, against "what you care about to enable either of those two", which is the plumbing.