summaryrefslogtreecommitdiff
path: root/spec/shared_behaviours/things_that_declare_options.rb
AgeCommit message (Collapse)AuthorFilesLines
2012-07-24Use rspec 2.11 compatible block syntaxPatrick Carlisle1-5/+5
In rspec 2.11, expectations on a block must take the form of expect...to or lambda...should. Other combinations of those are no longer accepted. This commit converts all mixed cases to use expect...to, as it seems to be the preferred syntax now.
2011-07-20(#6787) Add `default_to` for options.Daniel Pittman1-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>
2011-07-13(#7699) Help command should only list options onceDan Bode1-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.
2011-06-22(#8048) Gem install puppet no longer fails if rdoc enabled.Josh Cooper1-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>
2011-04-29Merge branch 'tickets/2.7.x/7289' into 2.7.xPieter van de Bruggen1-2/+5
2011-04-29(#7289) Specify order for option decorations.Pieter van de Bruggen1-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
2011-04-27(#6962) Finish documentation API on Face options.Daniel Pittman1-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.
2011-04-18(#7131) Remove support for optional arguments to optionsMax Martin1-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
2011-04-13(#6830) Fix UTF-8 encoding issue for Ruby 1.9Matt Robinson1-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>
2011-04-13maint: ensure we handle '-foo=' options correctly in faces.Daniel Pittman1-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>
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-04(#6749) detect duplicate aliases in a single option statement.Daniel Pittman1-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>
2011-04-04(#6749) implementing option handling in CLI string wrapperDaniel Pittman1-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>