summaryrefslogtreecommitdiff
path: root/spec/unit/lwrp_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* fix Layout/LeadingCommentSpaceLamont Granquist2018-07-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/HashSyntaxLamont Granquist2018-07-021-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Unification of shell_out APIsLamont Granquist2018-06-151-1/+1
| | | | | | | 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>
* mechanical conversion of most debug log statements to traceThom May2018-03-261-4/+4
| | | | Signed-off-by: Thom May <thom@chef.io>
* speedup lwrp testsLamont Granquist2017-12-061-3/+5
| | | | | | | | | | | | | | | | | | reset the global resource and provider handler maps before each and every test. note that mutation through the top-level keys will get preserved so this is not perfect, but deep-duping through every single test we run becomes expensive. this is sufficient to flush out the global state of all the test lwrp fixtures that we setup. it discovered several usage bugs where we either relied on this feature or where we were testing different fixtures from the ones we thought we were. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Update some more tests for removing use_inline_resources.Noah Kantrowitz2017-04-041-2/+0
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Try removing the const-ificiation of DSL-based resources/providers.Noah Kantrowitz2017-04-031-92/+15
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Chef-13: Chef::Resource cleanupLamont Granquist2017-03-081-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | most of this deletes useless old code. the change to lookup_provider_constant changes to more strictly stop using class name based lookups and to go through the resource resolver and provider resolver. as a result in order to find the provider class for a given dsl name you have to go through the resource resolver to find the resource in order to be able to pass a resource instance through the provider resolver. since the provider resolver api passes resources into blocks passed into provides api you must construct a resource instance. that means that providers need to be associated with resources in order to be looked up (which makes sense in Real Life(tm) use of Chef, but breaks quite a few lazy tests we had where we constructed providers without doing the work of wrapping them in a resource. note that as the deploy resource shows this filters into a changed behavior of the `provider` syntax where before `provider :revision` would look up Chef::Provider::Deploy::Revision via class-name based magic. this breaks that API so that `provider :deploy_revision` is used instead -- the symbol (or string) there is turned into a resource first via the Chef::ResourceResolver and then looked up via the Chef::ProviderResolver into Chef::Provider::Deploy::Revision. this is a breaking change but is also a bug fix so that the symbol here goes through the same lookup that you get when you type it in the DSL. i had considered implementing a lookup from a resource_name symbol to a provider, but in looking at how to implement that in the ProviderResolver the issue is that we really need to have a resource instance order to pass to the ProviderResolver. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* removing a Chef-13 deprecation i sorta disagree withLamont Granquist2017-02-281-8/+1
| | | | | | | | | this seems like entirely fine behavior to me. i don't see the benefit of forcing users to put all their actions on one line. mostly it was vargo and keiser who wanted this gone and since i'm the last one still at Chef i win the argument? Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Properly deprecate old Chef::Platform methodsLamont Granquist2016-12-071-4/+3
| | | | | | | | These should have been deprecated formally in 12.5.1 after the Dynamic Provider-Resolver'ing of the internal chef resources was completed. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-4/+4
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/VariableName copLamont Granquist2016-08-161-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* allow use_inline_resources for core chef providersLamont Granquist2016-03-211-1/+1
| | | | | | | | | | | | | * removes the DSL from InlineResources class * ActionClass is now responsible for mixing the DSL into action classes * apt_update provider converted over to use new syntax - does not need to mixin DeclareResource DSL - declares use_inline_resources - uses declare_resource instead of build_resource - converts def action_stuff to action :stuff - uses an execute resource instead of shell_out! - does not need the converge_by to update the action
* deprecate Chef::DSL::Recipe::FullDSLlcg/deprecate-fulldslLamont Granquist2016-03-161-3/+3
| | | | | | | | this module was created out of a bit of excessive paranoia instead of simply adding mixins that we always use with Chef::DSL::Recipe directly to Chef::DSL::Recipe. lets try and YAGNI this class and just add it directly. these modules are already injected into everyone's recipes and providers, so I can't imagine a huge amount of backcompat breaks.
* lazy module inclusion into DSL moduleslcg/use-and-lazy-module-includeLamont Granquist2016-03-151-0/+58
| | | | | | Chef::DSL::Recipe::FullDSL.send(:include, MyModule) will now patch all its descendants that it has been included into (works the way actual inheritance works now).
* autofixing whitespace copsLamont Granquist2016-02-051-5/+3
| | | | | | | | | | | | | | | | | | | | | | 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-35/+35
| | | | | | | 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.
* debug log messages upon reloaded resourcesif/warn-on-reload-resourceIsa Farnik2016-01-121-2/+2
| | | | tests for debug messages when reloading resources
* Update messaging to match LWRP -> Custom Resource renameTim Smith2015-10-211-1/+1
| | | | If you showed up in a post-LWRP world these would be confusing
* Re-separate priority map and DSL handler map so that provides has veto power ↵John Keiser2015-07-061-4/+4
| | | | over priority
* Fix up specsjdm/simplify-lwrp1Jay Mundrawala2015-06-301-136/+138
| | | | | | | | | | Loading the lwrp multiple times causes problems when comparing classes due to the their dynamic nature. It worked fine when we were overriding the things that checked. I've left the tests mostly as is, other than the fact that the test lwrp is loaded only once. The tests should still hold true, even with the new implementation.
* Added spec for #3607Jay Mundrawala2015-06-301-0/+10
|
* Revert "Merge pull request #3603 from chef/jdm/lwrp-base"Jay Mundrawala2015-06-301-10/+0
| | | | | This reverts commit 27d8675ec1c80f1eb7ec57f7b6c854441bb395ee, reversing changes made to 3501ba4020dc21377bc999e57e25eadb315ec783.
* Added spec for #3607Jay Mundrawala2015-06-301-0/+10
|
* Test updates for the changes to default actions.Noah Kantrowitz2015-06-291-4/+4
|
* Support arrays as input to actions / allowed_actionsjk/3535John Keiser2015-06-161-0/+39
|
* Ensure :nothing is in the list of allowed actions for an LWRPJohn Keiser2015-06-161-4/+4
|
* Make sure resource_name :x only removes automatic provides from that classJohn Keiser2015-06-081-3/+3
|
* Fix hyphenated LWRP nameshyphenated-lwrpJohn Keiser2015-06-031-2/+17
|
* Add regression test for LWRP in hyphenated cookbookdanielsdeleo2015-06-031-1/+32
|
* Convert LWRP provider tests to let bindingsdanielsdeleo2015-06-031-37/+52
|
* Fix issue #3463: use real constants instead of const_missingJohn Keiser2015-06-031-3/+124
|
* Add default_action and allowed_actions to Resource class, remove from LWRPJohn Keiser2015-06-011-4/+4
|
* Move resource_name up to Resource, and figure out its value automaticallyJohn Keiser2015-06-011-8/+0
|
* fix an lwrp default action testThom May2015-05-201-1/+1
|
* Merge branch 'master' of https://github.com/Kasen/chef into Kasen-masterThom May2015-05-201-3/+3
|\
| * Behavior of default_action method changed.Pavel Yudin2015-03-271-3/+3
| |
* | Fix LWRP instance.to_s to look like normal resources againjk/fix_lwrp_class_nameJohn Keiser2015-05-181-0/+8
| |
* | Add Chef::ResourceResolver.resolvejk/missing_method_missingJohn Keiser2015-05-131-0/+4
| |
* | Replace lookup_provider_constant and protect against deprecation in testsJohn Keiser2015-05-131-10/+22
| |
* | Deprecate Chef::Provider::LwrpClass the same way we did ResourceJohn Keiser2015-05-131-15/+20
| |
* | Convert "override LWRP" spec to one explicit check, be absolutelyJohn Keiser2015-05-131-12/+33
| | | | | | | | | | sure it didn't load by creating a global module inside the LWRP and checking it outside
* | Move LWRP class deprecation warning to const_missingJohn Keiser2015-05-131-18/+20
| |
* | Deprecate automatic method_missing and Chef::Resource lookupJohn Keiser2015-05-131-0/+2
|/ | | | | - Declare all resource DSL as methods on Chef::DSL::Resources - Declare all definition DSL as methods on Chef::DSL::Definitions
* specsLamont Granquist2015-02-051-6/+6
|
* fix LWRP constant lookupsLamont Granquist2015-02-031-0/+24
| | | | | | | | * providers had the same bug as CHEF-4117 on resources * removed the strict_const_defined method on Chef::Resource since ruby 1.8.7 deprecation made that method entirely trivial * added tests, verified the failure cases really work * todo added since i think we're leaking state in-between tests
* typo fixes - https://github.com/vlajos/misspell_fixerVeres Lajos2014-11-081-1/+1
|