summaryrefslogtreecommitdiff
path: root/spec/unit/provider/execute_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Reset logger in test to avoid global state persisting.Pete Higgins2020-07-161-7/+0
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Remove test file that added a method to top-level scope.Pete Higgins2020-06-261-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-131-1/+1
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-081-1/+1
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-151-5/+5
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Update wording in resource specs for attributes -> propertiesTim Smith2018-07-101-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Attribute -> Property in additional placesTim Smith2018-07-101-1/+1
| | | | | | Specs and comments, but we should get it right in those places as well Signed-off-by: Tim Smith <tsmith@chef.io>
* fix Style/HashSyntaxLamont Granquist2018-07-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* change "internal" to "default_env"Lamont Granquist2018-05-301-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add internal flag to shell_out and execute resourceLamont Granquist2018-05-251-15/+16
| | | | | | | | this will wind up replacing shell_out_with_systems_locale. also fixes an issue in the sysctl provider. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* [ci skip] a typoLamont Granquist2017-06-301-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix execute resource to use shell_out_with_systems_localeLamont Granquist2017-06-301-14/+32
| | | | | | | | | | | | | | | | | | This may be a breaking change for some users coming from 13.0/13.1 but this was the intended way that this API would function in Chef 13.0. With this change we stop inserting environment variables into execute resources. That means that whatever users type into the execute resource should much more exactly agree with the response on the command line, which will close a shedload of bugs and is how Chef 13.0 was intended to operate. We no longer globally mangle the PATH or the LANG/LC_ locale environment variables. The way that it worked in Chef 13.0/13.1 resulted in the internal chef embedded/bin directory being prepended to the PATH environment variable in the `execute` resource, which was never intended. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13: relative creates paths in the execute resource requires a cwdLamont Granquist2017-02-281-13/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fixed specsnimisha2017-02-021-93/+0
| | | | Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
* Rubocop violations in execute resource alternate user implementationadamedx2017-02-021-11/+11
|
* Windows alternate user support for execute resourcesAdam Edwards2017-02-021-0/+92
|
* better chef+ruby rspec constraintsLamont Granquist2016-03-031-2/+2
| | | | | | | | lets us use Gem::Dependency constraints directly as rspec constraints for matching Chef::Version and RUBY_VERSION. copies some magic sauce from bundler that does something similar
* autofixing whitespace copsLamont Granquist2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | 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"
* Use double quotes by defaultThom May2016-01-141-1/+1
| | | | | | | 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
* respond to review commentsThom May2015-11-091-64/+70
| | | | | | | | | | the logic is now: if the resource is not sensitive, and if it's explicitly requested to be streamed or if the log level is info or debug, then we'll consider streaming it. If we're configured to send the output to the events stream, we'll do so. Otherwise, if we're not daemonized and have a TTY, we'll go to STDOUT
* Implement live streaming for execute resourcesAdam Jacob2015-11-091-25/+77
| | | | | | | | | | This brings live streaming of execute resource output to the output formatters. It also adds a mechanism for checking to see if an output formatter is in use through the event dispatch system. It adds a new configuration option, "always_stream_execute", which does what it says on the tin.
* add spec for stdout/stderr suppresion in error of sensitive execute resourceRanjib Dey2015-10-241-0/+9
|
* Stub `windows?` on ChefConfig so it applies to configdanielsdeleo2015-05-201-1/+1
|
* Allow execute unit tests to run on windowsJay Mundrawala2014-12-161-0/+1
|
* Execute and Script Resource improvementsLamont Granquist2014-12-081-68/+138
| | | | | | | | | | | - Warning on incorrect usage of the command resource in any script resource - Warning on code in script resource being nil - Specs added to force deprecation of incorrect usage in Chef-13 - Specs added around the (supported) incorrect usage in Chef-12 - Cleanup+Modernization of providers and specs - Fixed some global state bugs around the Chef::Log.level in the spec tests
* updating resources/providers unit tests to rpsec3Lamont Granquist2014-10-241-27/+27
| | | | mechanically generated patch using transpec 2.3.7 gem
* Use let for optsjoe.nuspl2014-09-111-3/+5
| | | | Change-Id: Icce61096e869abe23ce847691cd65078b0b62cf0
* Factored out opts into before clause.joe.nuspl2014-09-101-15/+10
| | | | Change-Id: I1d9e384187c2f7762598c41598cddd35ce9171be
* Added spec tests for sensitive execute resourcesjoe.nuspl2014-09-101-0/+19
| | | | Change-Id: I4794d9c8ec38dff58c793bf4c4464862e70dc05b
* s/stub!/stub/gLamont Granquist2014-01-291-5/+5
| | | | fix deprecation warnings
* Normalize whitespace on all filesSeth Vargo2013-09-261-2/+2
|
* execute check existense of sentiel file with respect to cwdPavel Valodzka2013-04-121-1/+27
|
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+63
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!