summaryrefslogtreecommitdiff
path: root/spec/support/shared/unit
Commit message (Collapse)AuthorAgeFilesLines
* Clean up some interdependencies in script resource tests.Pete Higgins2020-08-072-48/+21
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Remove a deprecated use of `.ordered` on an `allow` expectation.raise-on-raise_errorPete Higgins2020-07-151-1/+0
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Pick some of the unit test fixes from #10068lcg/win-unit-test-cherrypickLamont Granquist2020-06-261-8/+12
| | | | | | This picks some of the more obviously correct looking fixes from #10068 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix a test to avoid rspec warning.Pete Higgins2020-06-101-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Replace nonsense word with other silly words.Pete Higgins2020-05-181-4/+4
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Fix more ruby 2.7 warning logspamlcg/more-ruby-27-logging-suppressionLamont Granquist2020-04-281-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-1314-14/+14
| | | | | | | | 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>
* some spec typosVivek Singh2020-04-072-2/+2
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix all(?) circular requires coming from the specs.Ryan Davis2020-03-164-7/+0
| | | | | | | Lots more in lib, but that's out of scope for this. I'm just trying to make it easier to debug a failing spec when needed. Signed-off-by: Ryan Davis <zenspider@chef.io>
* Remove constraints on specsnuke_old_specsTim Smith2020-02-281-2/+2
| | | | | | Run it all. Signed-off-by: Tim Smith <tsmith@chef.io>
* Add output for the file provider verification (#9039)Lamont Granquist2019-12-091-4/+16
|\ | | | | Add output for the file provider verification
| * Fix undefined method `dirname' for Chef::Provider::File:Classlcg/file-verifier-outputVivek Singh2019-12-021-4/+16
| | | | | | | | | | | | | |  - Fix failing specs.  - Fix long strings getting truncated for RSpec expectations. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* | Removed method for defining return codes, changed to evaluate stderr on exit ↵skippy2019-11-191-15/+14
| | | | | | | | | | | | code 12 Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
* | Resolved all chefstyle failuresskippy2019-11-171-14/+14
| | | | | | | | Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
* | re-un-inverted my previous 3am coding adventure in double negativesskippy2019-11-171-3/+3
| | | | | | | | Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
* | Resolved failing tests, fixed inverted logicskippy2019-11-171-12/+21
| | | | | | | | Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
* | Resolved issues with tests not receiving exactly what they expected.skippy2019-11-171-5/+5
|/ | | | | | Resolved new method in linux_user not returning the correct array. Signed-off-by: Jonathan Jones <gitmaster@thespooky.house>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-081-4/+4
| | | | | | | | | | | | | 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>
* fix 4 copsLamont Granquist2019-07-051-3/+9
| | | | | | | | | | | | | | - Layout/MultilineMethodCallBraceLayout - Layout/ClosingParenthesisIndentation - Layout/IndentFirstArgument EnforcedStyle: consistent - Layout/BlockEndNewline the first of these autocorrected to horrible looking code which exposed that we really needed the other three as well, which also cleaned up a bunch of other terrible looking code. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NegatedIfLamont Granquist2019-07-051-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/EmptyLiteralLamont Granquist2019-07-052-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/MethodCallWithoutArgsParenthesesLamont Granquist2019-07-021-1/+1
| | | | | | | | zero args methods don't get parens. this certainly reads better than the inverse. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/SymbolArrayLamont Granquist2019-07-024-14/+14
| | | | | | start enforcing using %i{} instead of arrays of symbols Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-021-0/+1
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #8307 from ↵Tim Smith2019-05-071-0/+95
|\ | | | | | | | | MsysTechnologiesllc/Kapil/MSYS-986_Move_response_file_and_response_file_variables_out_of_base_package_resource package: move response_file and response_file_variables out of base package resource
| * Move response_file and response_file_variables out of base package resourceKapil Chouhan2019-05-071-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> Fix for Move response_file and response_file_variables out of base package resource Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> update require changes Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> Updated require changes Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com> Fixed some unit test cases Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
* | Tell people what file a link is pointing at.Phil Dibowitz2019-04-291-0/+1
|/ | | | | | | | | In the event you are managing a file `/etc/file` with a `file` resource, but it turns out to be a link to `/etc/passwd` and you are trying to figure out what overwrite `/etc/passwd`, there is no indication in the logs. Let's add one. Signed-off-by: Phil Dibowitz <phil@ipom.com>
* As per the review commentsNimesh-Msys2019-02-041-1/+1
| | | | | | | - Using `flags` attribute from resources itself - Fixed and add the required test cases Signed-off-by: Nimesh-Msys <nimesh.patni@msystechnologies.com>
* change HTTPServerException to HTTPClientException for ruby 2.6Lamont Granquist2019-01-032-7/+7
| | | | | | includes backcompat for 2.5 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/LeadingCommentSpaceLamont Granquist2018-07-022-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/DotPositionLamont Granquist2018-07-021-18/+18
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/HashSyntaxLamont Granquist2018-07-026-34/+34
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Unification of shell_out APIsLamont Granquist2018-06-151-11/+11
| | | | | | | converts all usage to just shell_out() from the numerous helper utilities that we've had previously. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #7249 from chef/lcg/cleanup-userLamont Granquist2018-05-211-3/+3
|\ | | | | Cleanup AIX and Solaris user resources.
| * clean up updating_home?lcg/cleanup-userLamont Granquist2018-05-101-3/+3
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Add additional resource specsTim Smith2018-05-161-1/+1
|/ | | | | | Auto generated from the resource inspector Signed-off-by: Tim Smith <tsmith@chef.io>
* [MSYS-725] [chef#6073] allow forcing senistive to false on execute and batch ↵Vasu11052017-12-261-1/+8
| | | | | | resource Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Update the client.d stubAllan Espinosa2017-12-201-0/+2
| | | | Signed-off-by: Allan Espinosa <aespinosa33@bloomberg.net>
* Slight improvements to validation failures. Shows the failing command if ↵Noah Kantrowitz2017-12-181-1/+9
| | | | | possible and doesn't show anything for sensitive resources to be safe. Refs https://github.com/chef/chef/issues/4793 and ping @chef/client-core for review.
* fixes for rubocop 0.49.1 engineLamont Granquist2017-06-201-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove a whole bunch more stubbed property stuff.Noah Kantrowitz2017-04-111-3/+3
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* convert additional resource methods to propertieslcg/chef-resource-propertiesLamont Granquist2017-03-071-3/+0
| | | | | | | converts sensitive, retries, retry_delay and ignore_failure to properties Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef 13: remove unused path property from execute resourceLamont Granquist2017-02-281-9/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13 break: script and all its subclasses now errors on 'command' propertyLamont Granquist2017-02-281-9/+1
| | | | | | | | | | | | | This was always a coding bug. The `command` property is only used internally but is exposed for users to twiddle because script subclasses execute. Thus this still violates Liskov Substitution and this is not an is-a relationship where inheritance might be appropriate, because the script resource should /use/ the execute resource and not /be an/ execute resource. The more you know... Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Rubocop violations in execute resource alternate user implementationadamedx2017-02-021-7/+7
|
* Windows alternate user support for execute resourcesAdam Edwards2017-02-021-1/+38
|
* Do not modify File's new_resource during why-runScott Christopherson2017-01-201-0/+10
| | | | | | | | | | | The `File` provider's `action_create` method would modify the `new_resource` object during a `why-run`. This was problematic when a `File` resource was configured with a `notifies :before` because resources with `before` timers have their actions executed twice. [Once](https://github.com/chef/chef/blob/a2e1d1d4edb74a968b416517fdbdf35740686467/lib/chef/runner.rb#L54-L57) in `why-run` mode to see if the other resources need to be notified, and then executed [once again](https://github.com/chef/chef/blob/a2e1d1d4edb74a968b416517fdbdf35740686467/lib/chef/runner.rb#L68-L69) after the `before` notifications are resolved. This behavior would result in existing File resources not getting their ownership and permissions updated properly during a converge. Signed-off-by: Scott Christopherson <scott@chef.io>
* add check for the centos why-run buglcg/linux-user-check-lockLamont Granquist2016-08-241-0/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* rewrite linu_user provider check_lockLamont Granquist2016-08-241-38/+16
| | | | | | | | | | | | this removes the kinda brittle kinda insane parsing of the installed rpm version. now we're just less strict about the exit 1 code and fail on the output not being what is expected. this also likely fixes a bug in rhel in why-run mode where shell_out! would have failed on the user-not-found and raised an exception that would have ended the run. the code before certainly looks buggy. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* sort out the -m / -M mess a bit betterLamont Granquist2016-08-231-9/+9
| | | | | | -M is not valid for usermod Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>