summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* add ruby tests 3.0/3.1jayashri garud2022-04-071-0/+1
| | | | Signed-off-by: jayashri garud <jgarud@msystechnologies.com>
* Update spec/spec_helper.rb file_dirTim Smith2020-09-161-1/+0
| | | | | Signed-off-by: Tim Smith <tsmith@chef.io> Co-authored-by: pete higgins <pete@peterhiggins.org>
* Update spec/mixlib/cli_spec.rb Tim Smith2020-09-161-1/+1
| | | | | Signed-off-by: Tim Smith <tsmith@chef.io> Co-authored-by: pete higgins <pete@peterhiggins.org>
* Replaces uses of __FILE__ with __dir__Tim Smith2020-09-082-2/+2
| | | | | | This makes these bits easier to read Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix minor typosspellingTim Smith2020-07-281-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix chefstyleVivek Singh2019-07-121-26/+24
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Don't explode when there are unknown keys in 'config'deprecation-fix-unknown-keysMarc A. Paradise2019-06-071-0/+12
| | | | | | | Update handle_deprecated_options to be graceful when 'config' has been modified externally to contain unknown keys. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Code review updates for deprecated_optionMIXLIB-CLI-63/deprecated-option-supportMarc A. Paradise2019-06-061-0/+43
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* [MIXLIB-CLI-63] Add deprecated_option supportMarc A. Paradise2019-06-061-6/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds deprecated option support by exposing a new ClassMethod, `deprecated_option`. It will generate a corresponding deprecated option, and if that option is used it will handle mapping of the old option to the new and issue a warning. `deprecated_option` accepts a subset of the parameters that `option` accepts. Most importantly, a deprecated option can't have a default value. There's a practical reason for this and a philosophical one. Practically, it makes it easy to track the situation where someone has set `use_separate_defaults` to `false`. In that case, we currently can't tell whether the user provided the flag, or it was set as a default. This could have been addressed, but: Philosphically it makes more sense to not have a default value on a deprecated item. If it's deprecated, you want people to stop using it. If it has a default, it's effectively forced in-use at all times. See function docs for further accepted parameters. To allow deprecated options without warnings, use parse_options as `parse_options(ARGV, show_deprecations: false)`. By default, warnings will be shown. This also moves some formatting code into its own class - it was causing methods to get mixed in that client classes didn't need; and I reached the point where I needed to access the formatting functions across methods in both Mixlib::CLI and Mixlib::CLI::ClassMethods. It made more sense to move them outside of the mixed-in bits, since it wasn't a concern of the caller that would be inheriting those methods. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Add more specs and use or not andTim Smith2019-05-131-5/+13
| | | | | | This seems to make more sense Signed-off-by: Tim Smith <tsmith@chef.io>
* Print out human readable lists of allowed CLI optionsTim Smith2019-05-131-1/+7
| | | | | | Give a nice friendly sentence and not an array. This uses the code we nuked from chef/chef that did the same. Signed-off-by: Tim Smith <tsmith@chef.io>
* Improve the --help text output of 'in:'btm/included_textBryan McLellan2019-05-131-1/+1
| | | | | | | The automatic addition of the 'in' options to the --help output could be more clear about what the list is. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* fix copyrightLamont Granquist2019-01-041-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix global state pollution issues across examplesLamont Granquist2019-01-042-5/+9
| | | | | | | | | | since classes are global state, having a single TestCLI class that threads through all the examples creates state pollution that can cause ordering problems. solve this by rewiring TestCLI to a new class every single time. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Run specs properlysyncTim Smith2018-07-241-0/+3
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Expand config in rspec helperTim Smith2018-07-241-0/+9
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* remove hashrockets syntaxLamont Granquist2018-06-262-53/+53
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* bugfix: if param :required is set to false and param :in is set the option ↵Yuri Zubov2018-03-231-5/+25
| | | | | | is required Signed-off-by: Yuri Zubov <y.zubov@sumatosoft.com>
* Opscode -> ChefTim Smith2016-08-231-2/+2
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Use rspec 3.XTim Smith2016-08-232-78/+77
| | | | | | This could be further fixed, but this gets us on 3.X without deprecation warnings Signed-off-by: Tim Smith <tsmith@chef.io>
* Make chefstyle happy.Noah Kantrowitz2016-06-161-1/+1
|
* Support two-argument procs for reducer-style arguments. This allows CLI ↵Noah Kantrowitz2016-06-161-0/+10
| | | | options which can be repeated.
* Fix chefstyle issuesThom May2016-05-051-3/+3
| | | | Signed-off-by: Thom May <thom@may.lt>
* Merge pull request #13 from chrisroberts/enhancement/option-inheritanceThom May2016-05-041-0/+48
|\ | | | | [MIXLIB-14] Option inheritance
| * Use the correct class when testing parent class options valuesChris Roberts2013-11-151-1/+1
| |
| * Include spec test with array default valueChris Roberts2013-11-151-1/+13
| |
| * Properly pass options during inheritance. Full dup to ensure proper option ↵Chris Roberts2013-04-181-0/+36
| | | | | | | | isolation.
* | chefstyle fixeslcg/chefrstyleLamont Granquist2016-02-122-30/+28
| |
* | Add basic rspec configurationdanielsdeleo2015-05-291-0/+7
| |
* | Fix rspec tests for ruby-1.8.7Mehrez Alachheb2014-07-081-1/+1
| |
* | Merge branch 'master' into malachheb-1.4.0Mehrez Alachheb2014-07-081-8/+8
|\ \ | | | | | | | | | | | | Conflicts: lib/mixlib/cli.rb
| * | Add API to access option parser without parsing optionsdanielsdeleo2014-04-251-6/+5
| | |
| * | Add cli_arguments--remaining arguments after stripping CLI optionsjk/preserve-name-argsJohn Keiser2013-12-051-2/+3
| |/
* | Fix code review notesMehrez Alachheb2014-06-121-5/+5
| |
* | Add option key ':in' to specifie that option value should be included in ↵Mehrez Alachheb2013-06-151-1/+28
|/ | | | the given list
* [CHEF-3497] optionally store default values separatelydanielsdeleo2013-01-091-1/+22
| | | | | | | This will make it easier for knife to apply config settings in the proper order (default < config file < command line). It's not possible to do without this patch because knife must parse command line options to determine which config file to use.
* remove whitespace in testsdanielsdeleo2013-01-091-31/+31
|
* CHEF-1563: required options always failJohn Keiser2011-08-251-0/+21
|
* CHEF-2571: support negated bool parametersJohn Keiser2011-08-251-2/+9
| | | | | Using --[no-]xxx on a boolean parameter lets the user specify the value as false, like in OptionParser.
* upgrade to rspec 2Daniel DeLeo2011-03-041-4/+0
|
* adding test for parse_options return behaviorStephen Delano2010-03-261-3/+7
|
* [CHEF-828] Testsdreamcat42010-03-051-1/+12
|
* Add spec options for rspec/rake specAJ Christensen2009-05-151-0/+4
|
* Convert mixlib-cli to jeweler.AJ Christensen2009-05-121-1/+1
|
* Initial commitAdam Jacob2009-03-122-0/+206