summaryrefslogtreecommitdiff
path: root/spec/unit/knife_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Specify a profile on the command lineThom May2017-12-181-0/+2
| | | | Signed-off-by: Thom May <thom@chef.io>
* Checking for proxy error separatelynimisha2017-06-021-0/+22
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* Replace a few dangling references to `knife cookbook site vendor` that ↵Noah Kantrowitz2017-04-041-2/+2
| | | | | | don’t really matter. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Implement `--config-option` CLI opt for knifedan/config-option-in-knifedanielsdeleo2016-10-181-0/+31
| | | | | | | | | | | The `--config-option` CLI option allows setting any `Chef::Config` setting on the command line, which allows applications to be used without a configuration file even if a desired config option does not have a corresponding CLI option. This CLI option was present in the help output for knife but was not actually implemented. Moving the behavior into chef-config allows us to use it for both `chef-client` and `knife`. Signed-off-by: Daniel DeLeo <dan@chef.io>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-6/+7
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Adding specs for rehash updatetyler-ball2016-03-041-0/+7
|
* autofixing whitespace copsLamont Granquist2016-02-051-13/+13
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-021-2/+2
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-021-1/+1
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Autofixing Style/PercentLiteralDelimeterslcg/percentliteraldelimetersLamont Granquist2016-01-181-22/+22
| | | | | | See chef/chefstyle#11 for analysis and discussion. We select '{}' since audit of our source code shows that is the most common, and that used to be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
* Use double quotes by defaultThom May2016-01-141-22/+22
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* autocorrecting Style/TrailingCommalcg/trailing_commaLamont Granquist2016-01-131-1/+1
| | | | chefstyle -a fixed 1044 occurrances
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-111-3/+3
| | | | | | | In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
* Avoid squashing/humanizing the exception when config[:verbosity] == 2btm/knife-backtraceBryan McLellan2015-11-061-1/+14
| | | | | | | | | | | | | | | | | We create an instance of Chef::Knife::Bootstrap in knife-ec2, but we've already processed ARGV so we substitute and process an empty argv. config[:verbosity] comes from Chef::Application::Knife. Normally we merge those options with the ones from the knife subcommand in Chef::Knife.run. Since we don't in this case, we don't set it to the default of 0 that is specified there, leaving it nil. We set Chef::Config[:verbosity] to config[:verbosity] in Chef::Knife#initialize which now becomes nil. This change makes it so we do not update Chef::Config[:verbosity] if config[:verbosity] is nil, so that later when we rescue we don't call humanize_exception if Chef::Config[:verbosity] is 2.
* Fixed knife_spec unit testJay Mundrawala2015-11-051-1/+4
| | | | | This is failing on both my and btm's machine. No idea how it passes in other places.
* Improve detection of ChefFS-based commands in `knife rehash`ssd/rehash-cheffsSteven Danna2015-10-291-0/+8
| | | | | | | | | | | | ChefFS-based commands have a superclass (Chef::ChefFS::Knife) which defines its own inherited method that calls super. This breaks our detection of where the subcommand is defined since the file with the definition is no longer at the top of the call stack. This commit special-cases subclasses with a superclass of Chef::ChefFS::Knife to account for this. Fixes #4089
* Added versioned Chef Object API support code and repaired Chef::User.create.tylercloke2015-06-051-4/+10
| | | | Also added Chef::User.create V1 API support. Chef::User.create will attempt to use V1 of the server API, and if it fails, it will fall back to V0.
* Stub config loading that was breaking tests on my boxdanielsdeleo2015-05-201-0/+9
|
* change default log_location + log_level for knifeLamont Granquist2015-05-151-0/+12
| | | | | | | | | send logging to STDERR and drop default log_level to :warn so that we can see warnings again. logging needs to go to STDERR so that we don't break someone's 'API' where they're piping stdin to some filter. we believe the log_level was not warn in order to suppress warns off of 404s which no longer warn by default now.
* Nice error handling for unsupported API version in formatters/*.rb.tylercloke2015-05-041-2/+2
|
* Nice error formatting for unsupported API version in Knife.tylercloke2015-05-041-0/+10
|
* Implemented X-Ops-Server-API-Version in Chef requests.tylercloke2015-05-041-1/+2
| | | | | | | | | | This takes advantage of Chef::HTTP::Authenticator.handle_request. After the authentication_headers have been merged, it adds: {'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::SERVER_API_VERSION} Chef::HTTP::Authenticator::SERVER_API_VERSION should corrospond to the max version of the server the client is compatible with. We are starting at "0". I also removed outer level lets :base_header and :req_with_body_headers from rest_spec.rb as they were never used anywhere. Another :base_header was defined in a tighter part of the spec and was only used in that scope, and :req_with_body_headers was never used anywhere.
* Add --no-listen option to disable zero binding to portdanielsdeleo2015-04-011-0/+5
|
* Add specific error messaging for SSL errors to knifedanielsdeleo2014-12-151-0/+15
| | | | | | | | | | | | | | Knife now gives an error message like this when an SSL error occurs: ``` ERROR: Could not establish a secure connection to the server. Use `knife ssl check` to troubleshoot your SSL configuration. If your Chef Server uses a self-signed certificate, you can use `knife ssl fetch` to make knife trust the server's certificates. Original Exception: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ```
* Convert knife specs to let bindingsdanielsdeleo2014-12-151-64/+79
|
* Fix knife plugin path searchingLamont Granquist2014-12-031-0/+5
| | | | | | | | | | | | | | | | | | Unreleased Chef 12.0.0 bug caught in testing where only the searching upwards from PWD to find .chef in order to get the plugin path for knife was busted. The chef_config_dir was being used before load_config was being called, so it was nil, which broke finding knife plugins. This was fixed by adding some lazy initialization of the config_loader object itself and the chef_config_dir. The reset_config_loader! is added entirely to reset the global state for unit testing. This whole class is a bit horrible and needs to have all its global state removed from it, class methods removed, class ivars and the class-variable-in-a-class-method-for-inheritance-lolwut needs to be removed. Unfortunately, that requires some delicate surgery because Chef::Knife gets used as a public API, and is beyond the scope of gettting Chef 12 shipped.
* typo fixes - https://github.com/vlajos/misspell_fixerVeres Lajos2014-11-081-1/+1
|
* Update to RSpec 3.Claire McQuin2014-10-291-91/+91
|
* print the path to the configuration file usedAlex Pop2014-10-041-1/+18
|
* Extract Knife config file find/load to a reusable componentdanielsdeleo2014-09-031-30/+3
|
* Update tests for CHEF-4760 change.Chris Jerdonek2014-07-211-14/+14
|
* Request on https scheme no longer sets default 443 port in Host header.Klaas Jan Wierenga2014-06-071-1/+1
|
* Prevent code reloading in knife tests (fixes constant warnings)danielsdeleo2014-04-241-0/+3
|
* - Adding X-Remote-Request-Id to the set of headers for every request from ↵PrajaktaPurohit2014-02-071-0/+55
| | | | | | | | | | CCR and knife that will be sent to erchef - Each knife request has a different X-Remote-Request-Id, where as it remains the same for all requests originating from the same chef-client run. - Adding and fixing tests
* s/stub!/stub/gLamont Granquist2014-01-291-29/+29
| | | | fix deprecation warnings
* Check for ENV['CD'] instead of ENV['PWD'] on windows.sersut2013-11-051-1/+6
| | | | Also the associated test is removed as I am not sure how it should be fixed.
* Reset configuration before each testJohn Keiser2013-09-161-1/+0
|
* Use Chef::Config.reset in tests instead of save/load configJohn Keiser2013-09-131-2/+1
|
* [CHEF-3932] Add unit tests for Knife's lazy dependency loadingTeemu Matilainen2013-04-111-0/+21
|
* [CHEF-3497] apply config in the desired orderdanielsdeleo2013-01-141-0/+30
| | | | | | | | | Takes advantage of new mixlib-cli option to keep default values from the mixlib-cli DSL separate from user-supplied values. Config settings are merged: 1. Defaults from mixlib-cli DSL 2. Settings from Chef::Config[:knife] 3. Values from CLI options
* [CHEF-3663] Search for .chef in ENV[PWD] if setdanielsdeleo2012-12-051-0/+23
| | | | | | Prefer ENV["PWD"] for current working dir, but fall back to Dir.pwd if not set. Fixes config path searching when part of the path hierarchy is a symlinked directory.
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+295
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!