summaryrefslogtreecommitdiff
path: root/spec/unit/provider/template/content_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* fix Layout/AlignArgumentslcg/new-chefstyleLamont Granquist2019-07-021-28/+28
| | | | | | | | | | | | | | this is using: Layout/AlignArguments: Enabled: true EnforcedStyle: with_fixed_indentation the default style can use really excessive whitespace. on starting lines which are already long, it fully indents across to where the arguments start and then begins the line there. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-151-1/+1
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/IndentHeredocLamont Granquist2018-07-021-15/+15
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/HashSyntaxLamont Granquist2018-07-021-29/+29
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-171-8/+8
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* auto fixing some rubocopsLamont Granquist2016-02-091-3/+3
| | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* 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-18/+18
| | | | | | | 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.
* Fix AppVeyorsalam/template-fixSalim Alam2015-10-011-1/+1
|
* Clean up tests, fix bug in tempfile_openSalim Alam2015-09-301-8/+12
|
* Get rid of truthy/falseySalim Alam2015-09-301-8/+8
|
* Use Chef::FileContentManagement::Tempfile to create temp fileSalim Alam2015-09-291-0/+46
|
* PR feedbackLamont Granquist2015-08-181-1/+1
|
* CHEF-5012: add methods for template breadcrumbsLamont Granquist2015-08-181-0/+41
| | | | | | | | | | | | | | adds: - cookbook_name - recipe_name - recipe_line_string - recipe_path - recipe_line - template_name - template_path accessible both as instance var (@-) and method (bare), like @node/node.
* updating resources/providers unit tests to rpsec3Lamont Granquist2014-10-241-9/+9
| | | | mechanically generated patch using transpec 2.3.7 gem
* Make FileVendor configuration specific to the two implementationsdanielsdeleo2014-07-301-1/+1
| | | | | | | | | | | | | | | | FileVendor previously was configured by storing a closure/anonymous function as a class instance variable. This had the following downsides: * The API was too general, which caused a lot of code repetition * The block was lazily evaluated, which hid errors and made testing more difficult * The closures captured references to classes with references to large data structures, which complicates GC. Since we've only ever had the same two implementations of FileVendor, we can encapsulate configuration of the FileVendor factory by wrapping each configuration option in a method. As a side benefit, arguments to these methods will be eagerly evaluated, which makes it easier to detect errors.
* s/mock\(/double(/gLamont Granquist2014-01-291-3/+3
|
* s/stub!/stub/gLamont Granquist2014-01-291-5/+5
| | | | fix deprecation warnings
* Add helper method/module support to template resourcedanielsdeleo2013-05-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds helper methods to a template via the following syntax: ``` template "name" do # singular method definition: helper(:method_name) { method_body } # inline module definition helpers do def method_name method_body end end # external module inclusion helpers(MyHelperModule) end ``` In each of the above cases, variables defined by Chef (e.g., `@node`) or the user (via `:variables => {}`) can be accessed as normal. Could use the following improvements: - Template partials are not supported - Input validation on Resource::Template should be improved - Needs Unit tests for Template provider/implementation classes
* more spec test workLamont Granquist2013-03-221-0/+70