summaryrefslogtreecommitdiff
path: root/spec/unit/node
Commit message (Collapse)AuthorAgeFilesLines
* add some unit testing of new node APIslcg/attribute-setting-eventLamont Granquist2016-10-311-1/+46
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* rename __path to __path__ and __node to __node__lcg/node-path-trackingLamont Granquist2016-10-251-1/+1
| | | | | | | | | | | | consistency with Unchain here: https://github.com/chef/chef/blob/master/lib/chef/decorator/unchain.rb#L23-L24 and with SimpleDelegator: https://ruby-doc.org/stdlib-2.1.0/libdoc/delegate/rdoc/SimpleDelegator.html#method-i-__getobj__ Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove breadcrumb stateLamont Granquist2016-10-251-87/+24
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* standardize initializer args for VividMash+ImmutableMashLamont Granquist2016-10-251-2/+3
| | | | | | | | | | | | | | | | | | | if anyone is using these directly this might be a breaking change, although it makes it considerably easier to use VividMash and IMO ImmutableMash is an implementation detail of the deep merge cache and Chef::Node object. we definitely have never documented these APIs, so I think the onus is on the consumer to update their code. VividMash.new() should now work. VividMash.new({ foo: :bar }) should also now work. IDK what object people would have been passing in as the root object before. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* modify attributes and nodes tests for deeply converting_valuesLamont Granquist2016-09-232-1/+50
| | | | | | | | slightly more succinct and strict about types, also trying to keep the attributes tests associated with attributes even though we mix them all up like crazy anyway... Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix for #5094 12.12.13 node.default_unless issueLamont Granquist2016-07-081-20/+53
| | | | | | note that the node_spec test in this commit is not red on master so it ain't testing the right thing yet, but this fixes the issue in chef-shell...
* Attributes v1.1 changeslcg/attributes-v1.1Lamont Granquist2016-06-273-9/+355
| | | | | | | | | | | - fixes *_unless behavior and set_unless_value_present hack from Chef 12 - simplifies rm_* code - introduces functional read/write/unlink/exist? API - deprecates method_missing access to attributes for Chef 13 - deprecates set/set_unless aliases for Chef 14 - removes MultiMash mess that I wrote for Chef 13 https://github.com/chef/chef/pull/5029 for more details
* Too much log output and unnecessary warnings! Suppress that shit.Kartik Null Cating-Subramanian2016-04-252-3/+3
|
* flip multiline function arguments aroundlcg/rubocop-0.37.2Lamont Granquist2016-02-191-13/+13
| | | | no enforced trailing comma on arguments...
* deal with 0.37.2 renamed copsLamont Granquist2016-02-181-2/+2
| | | | | | | | | | | | | | | 252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
* pull rubocop 0.37.2 into chefstyleLamont Granquist2016-02-121-110/+110
| | | | | this is from the same ruleset that we had, but the new code catches more conditions.
* autofixing auto-inserted delimiterslcg/chefstyle-batchLamont Granquist2016-02-091-25/+25
|
* auto fixing some rubocopsLamont Granquist2016-02-091-25/+25
| | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* autofixing whitespace copsLamont Granquist2016-02-052-198/+152
| | | | | | | | | | | | | | | | | | | | | | 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-022-3/+3
| | | 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-022-2/+2
| | | 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-022-2/+2
| | | 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-182-4/+4
| | | | | | 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-142-24/+24
| | | | | | | 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-132-49/+49
| | | | chefstyle -a fixed 1044 occurrances
* Completing tests for https://github.com/chef/chef/pull/2310, fixes ↵tball/complete-2310tyler-ball2015-02-111-0/+20
| | | | https://github.com/chef/chef/issues/1562
* Merge branch 'typofixes-vlajos-20141107' of github.com:vlajos/chef into ↵tyler-ball2014-11-251-1/+1
|\ | | | | | | tball/contrib-pass
| * typo fixes - https://github.com/vlajos/misspell_fixerVeres Lajos2014-11-081-1/+1
| |
* | adding some more specs around to_hashlcg/to-hash-specsLamont Granquist2014-11-201-0/+28
| |
* | typo fix in specsLamont Granquist2014-11-191-1/+1
| |
* | add specs busted by dup removalLamont Granquist2014-11-191-0/+34
| |
* | fix reset_cache specs busted by removing thatLamont Granquist2014-11-191-44/+0
|/
* chef-12 attribute changesLamont Granquist2014-11-081-4/+2
| | | | | | - adding rm, rm_default, rm_normal, rm_override APIs - adding default!, normal! and override! APIs - changing force_default! and force_override! APIs
* Update to RSpec 3.Claire McQuin2014-10-292-162/+162
|
* Silence warnings when testing deprecated APIsdanielsdeleo2014-04-241-2/+15
|
* Fix rspec warningsdanielsdeleo2014-04-241-4/+4
|
* [CHEF-5132] more tests added for ImmutableCollections #to_a and #to_hash methodsXabier de Zuazo2014-03-281-9/+41
|
* [CHEF-5132] ImmutableCollections #to_a and #to_hash tests changed to use ↵Xabier de Zuazo2014-03-281-19/+19
| | | | #be_instance_of and cleaned
* [CHEF-3953] ImmutableMash and ImmutableArray should implement to_hash and ↵brianbianco2014-03-281-0/+23
| | | | | | | | to_a respectively - ImmutableMash now implements a to_hash method. This recurses through the ImmutableMash and returns a fully mutable Hash - ImmutableArray now implements a to_a method. This recurses through the ImmutableArray and returns a fully mutable Array - Unit tests added for both of the above methods
* Merge branch 'CHEF-4799' of github.com:criteo/chef into contributions-cc-51sersut2014-03-122-1/+12
|\
| * [CHEF-4799] Handle non-dupable elements when duping attribute arraysPierre Ynard2014-01-102-1/+12
| |
* | fix busted spec exposed by rpsec-2.14-izationLamont Granquist2014-01-291-1/+1
| | | | | | | | | | | | | | the behavior it is testing has never worked. it can't really work since you're blowing up in String#[]= long before you could hit the attribute code. changed the test to test something slightly more useful.
* | fix should_not raise_error(SpecificException)Lamont Granquist2014-01-291-3/+3
|/
* Normalize whitespace on all filesSeth Vargo2013-09-262-13/+13
|
* [CHEF-3806] add attribute value debugdanielsdeleo2013-01-291-0/+31
|
* [CHEF-3799] fixes TypeError for puts on VividMashdanielsdeleo2013-01-281-0/+13
|
* fix errors when merging deeply nested valuesdanielsdeleo2013-01-251-0/+11
|
* make merge between precedence overwrite arraysdanielsdeleo2013-01-251-0/+23
|
* CHEF-3688 remove stale attribute read protectionAdam Jacob2012-12-122-199/+2
| | | | | | This commit removes stale attribute read protection, as it does more harm than good. Includes removal of passing "root" around to immutablize.
* [CHEF-3680] don't invalidate computed attributes on dupdanielsdeleo2012-12-111-0/+11
|
* [CHEF-3680] #merge isn't destructive, #merge! isdanielsdeleo2012-12-111-1/+1
|
* Add "force" level precedence to Node::Attributedanielsdeleo2012-11-091-0/+18
|
* [CHEF-2936] ensure all default and override attrs go in node jsondanielsdeleo2012-11-021-0/+24
| | | | | | | | | | default and override attributes are now split into components, so all the components need to be merged together to generate the serialized representation of a node. Unfortunately, this means that serializing a node is now lossy because the information about which component default and override attributes belong to is lost. In practice, this is not a major issue, since automatic, override, and default attributes are cleared by chef for each run.
* [CHEF-2936] add role and environment components to Node::Attributedanielsdeleo2012-11-021-0/+38
| | | | | | | | | I reformatted Chef::Node::Attribute because the indentation was busted. The actual code change is that Attribute now has components for role_default, env_default, role_override, and env_override, and merges them according to the precedence given in the documentation. These new components are not yet wired in to Chef::Node, however.
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-302-0/+1335
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!