chef 12.12.13-universal-mingw32 → 12.12.15-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/chef/node/common_api.rb +5 -0
- data/lib/chef/version.rb +1 -1
- data/spec/unit/node/vivid_mash_spec.rb +53 -20
- data/spec/unit/node_spec.rb +24 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6fca8d5d5f090202e35d7ff176885d0fd8f29c4
|
4
|
+
data.tar.gz: 5a1c70e97837df415dad3fa63cb56d00adf8be08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb00e8c61bf53b32ca2cf15a152dd9f2046e664c3e82948d1306b2b73aa38197427b24da4439cbc0b0311d986d99e538c2b18cb3baf034dbac7ecf34a0ef74f0
|
7
|
+
data.tar.gz: cd79de813022c5ae56d67207da6d7149bc84bee6182bea4cdf85d03d2a66b232cb458272f1722c78ec9bc46c9727d864cc5a0dbaf59a31323f6a307bd960a52c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
12.12.
|
1
|
+
12.12.15
|
data/lib/chef/node/common_api.rb
CHANGED
@@ -32,6 +32,7 @@ class Chef
|
|
32
32
|
# - autovivifying / autoreplacing writer
|
33
33
|
# - non-container-ey intermediate objects are replaced with hashes
|
34
34
|
def write(*args, &block)
|
35
|
+
root.top_level_breadcrumb = nil if respond_to?(:root)
|
35
36
|
value = block_given? ? yield : args.pop
|
36
37
|
last = args.pop
|
37
38
|
prev_memo = prev_key = nil
|
@@ -55,6 +56,7 @@ class Chef
|
|
55
56
|
# something that is not a container ("schema violation" issues).
|
56
57
|
#
|
57
58
|
def write!(*args, &block)
|
59
|
+
root.top_level_breadcrumb = nil if respond_to?(:root)
|
58
60
|
value = block_given? ? yield : args.pop
|
59
61
|
last = args.pop
|
60
62
|
obj = args.inject(self) do |memo, key|
|
@@ -69,6 +71,7 @@ class Chef
|
|
69
71
|
|
70
72
|
# return true or false based on if the attribute exists
|
71
73
|
def exist?(*path)
|
74
|
+
root.top_level_breadcrumb = nil if respond_to?(:root)
|
72
75
|
path.inject(self) do |memo, key|
|
73
76
|
return false unless valid_container?(memo, key)
|
74
77
|
if memo.is_a?(Hash)
|
@@ -100,6 +103,7 @@ class Chef
|
|
100
103
|
# non-autovivifying reader that throws an exception if the attribute does not exist
|
101
104
|
def read!(*path)
|
102
105
|
raise Chef::Exceptions::NoSuchAttribute unless exist?(*path)
|
106
|
+
root.top_level_breadcrumb = nil if respond_to?(:root)
|
103
107
|
path.inject(self) do |memo, key|
|
104
108
|
memo[key]
|
105
109
|
end
|
@@ -108,6 +112,7 @@ class Chef
|
|
108
112
|
# FIXME:(?) does anyone really like the autovivifying reader that we have and wants the same behavior? readers that write? ugh...
|
109
113
|
|
110
114
|
def unlink(*path, last)
|
115
|
+
root.top_level_breadcrumb = nil if respond_to?(:root)
|
111
116
|
hash = path.empty? ? self : read(*path)
|
112
117
|
return nil unless hash.is_a?(Hash) || hash.is_a?(Array)
|
113
118
|
root.top_level_breadcrumb ||= last
|
data/lib/chef/version.rb
CHANGED
@@ -32,6 +32,11 @@ describe Chef::Node::VividMash do
|
|
32
32
|
)
|
33
33
|
end
|
34
34
|
|
35
|
+
def with_breadcrumb(key)
|
36
|
+
expect(root).to receive(:top_level_breadcrumb=).with(nil).at_least(:once).and_call_original
|
37
|
+
expect(root).to receive(:top_level_breadcrumb=).with(key).at_least(:once).and_call_original
|
38
|
+
end
|
39
|
+
|
35
40
|
context "#read" do
|
36
41
|
before do
|
37
42
|
# vivify the vividmash, then we're read-only so the cache should never be cleared afterwards
|
@@ -40,27 +45,27 @@ describe Chef::Node::VividMash do
|
|
40
45
|
end
|
41
46
|
|
42
47
|
it "reads hashes deeply" do
|
43
|
-
|
48
|
+
with_breadcrumb("one")
|
44
49
|
expect(vivid.read("one", "two", "three")).to eql("four")
|
45
50
|
end
|
46
51
|
|
47
52
|
it "does not trainwreck when hitting hash keys that do not exist" do
|
48
|
-
|
53
|
+
with_breadcrumb("one")
|
49
54
|
expect(vivid.read("one", "five", "six")).to eql(nil)
|
50
55
|
end
|
51
56
|
|
52
57
|
it "does not trainwreck when hitting an array with an out of bounds index" do
|
53
|
-
|
58
|
+
with_breadcrumb("array")
|
54
59
|
expect(vivid.read("array", 5, "one")).to eql(nil)
|
55
60
|
end
|
56
61
|
|
57
62
|
it "does not trainwreck when hitting an array with a string key" do
|
58
|
-
|
63
|
+
with_breadcrumb("array")
|
59
64
|
expect(vivid.read("array", "one", "two")).to eql(nil)
|
60
65
|
end
|
61
66
|
|
62
67
|
it "does not trainwreck when traversing a nil" do
|
63
|
-
|
68
|
+
with_breadcrumb("nil")
|
64
69
|
expect(vivid.read("nil", "one", "two")).to eql(nil)
|
65
70
|
end
|
66
71
|
end
|
@@ -73,42 +78,42 @@ describe Chef::Node::VividMash do
|
|
73
78
|
end
|
74
79
|
|
75
80
|
it "true if there's a hash key there" do
|
76
|
-
|
81
|
+
with_breadcrumb("one")
|
77
82
|
expect(vivid.exist?("one", "two", "three")).to be true
|
78
83
|
end
|
79
84
|
|
80
85
|
it "true for intermediate hashes" do
|
81
|
-
|
86
|
+
with_breadcrumb("one")
|
82
87
|
expect(vivid.exist?("one")).to be true
|
83
88
|
end
|
84
89
|
|
85
90
|
it "true for arrays that exist" do
|
86
|
-
|
91
|
+
with_breadcrumb("array")
|
87
92
|
expect(vivid.exist?("array", 1)).to be true
|
88
93
|
end
|
89
94
|
|
90
95
|
it "true when the value of the key is nil" do
|
91
|
-
|
96
|
+
with_breadcrumb("nil")
|
92
97
|
expect(vivid.exist?("nil")).to be true
|
93
98
|
end
|
94
99
|
|
95
100
|
it "false when attributes don't exist" do
|
96
|
-
|
101
|
+
with_breadcrumb("one")
|
97
102
|
expect(vivid.exist?("one", "five", "six")).to be false
|
98
103
|
end
|
99
104
|
|
100
105
|
it "false when traversing a non-container" do
|
101
|
-
|
106
|
+
with_breadcrumb("one")
|
102
107
|
expect(vivid.exist?("one", "two", "three", "four")).to be false
|
103
108
|
end
|
104
109
|
|
105
110
|
it "false when an array index does not exist" do
|
106
|
-
|
111
|
+
with_breadcrumb("array")
|
107
112
|
expect(vivid.exist?("array", 3)).to be false
|
108
113
|
end
|
109
114
|
|
110
115
|
it "false when traversing a nil" do
|
111
|
-
|
116
|
+
with_breadcrumb("nil")
|
112
117
|
expect(vivid.exist?("nil", "foo", "bar")).to be false
|
113
118
|
end
|
114
119
|
end
|
@@ -121,27 +126,27 @@ describe Chef::Node::VividMash do
|
|
121
126
|
end
|
122
127
|
|
123
128
|
it "reads hashes deeply" do
|
124
|
-
|
129
|
+
with_breadcrumb("one")
|
125
130
|
expect(vivid.read!("one", "two", "three")).to eql("four")
|
126
131
|
end
|
127
132
|
|
128
133
|
it "reads arrays deeply" do
|
129
|
-
|
134
|
+
with_breadcrumb("array")
|
130
135
|
expect(vivid.read!("array", 1)).to eql(1)
|
131
136
|
end
|
132
137
|
|
133
138
|
it "throws an exception when attributes do not exist" do
|
134
|
-
|
139
|
+
with_breadcrumb("one")
|
135
140
|
expect { vivid.read!("one", "five", "six") }.to raise_error(Chef::Exceptions::NoSuchAttribute)
|
136
141
|
end
|
137
142
|
|
138
143
|
it "throws an exception when traversing a non-container" do
|
139
|
-
|
144
|
+
with_breadcrumb("one")
|
140
145
|
expect { vivid.read!("one", "two", "three", "four") }.to raise_error(Chef::Exceptions::NoSuchAttribute)
|
141
146
|
end
|
142
147
|
|
143
148
|
it "throws an exception when an array element does not exist" do
|
144
|
-
|
149
|
+
with_breadcrumb("array")
|
145
150
|
expect { vivid.read!("array", 3) }.to raise_error(Chef::Exceptions::NoSuchAttribute)
|
146
151
|
end
|
147
152
|
end
|
@@ -153,54 +158,63 @@ describe Chef::Node::VividMash do
|
|
153
158
|
end
|
154
159
|
|
155
160
|
it "should write into hashes" do
|
161
|
+
with_breadcrumb("one")
|
156
162
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
157
163
|
vivid.write("one", "five", "six")
|
158
164
|
expect(vivid["one"]["five"]).to eql("six")
|
159
165
|
end
|
160
166
|
|
161
167
|
it "should deeply autovivify" do
|
168
|
+
with_breadcrumb("one")
|
162
169
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
163
170
|
vivid.write("one", "five", "six", "seven", "eight", "nine", "ten")
|
164
171
|
expect(vivid["one"]["five"]["six"]["seven"]["eight"]["nine"]).to eql("ten")
|
165
172
|
end
|
166
173
|
|
167
174
|
it "should raise an exception if you overwrite an array with a hash" do
|
175
|
+
with_breadcrumb("array")
|
168
176
|
expect(root).to receive(:reset_cache).at_least(:once).with("array")
|
169
177
|
vivid.write("array", "five", "six")
|
170
178
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => { "five" => "six" }, "nil" => nil })
|
171
179
|
end
|
172
180
|
|
173
181
|
it "should raise an exception if you traverse through an array with a hash" do
|
182
|
+
with_breadcrumb("array")
|
174
183
|
expect(root).to receive(:reset_cache).at_least(:once).with("array")
|
175
184
|
vivid.write("array", "five", "six", "seven")
|
176
185
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => { "five" => { "six" => "seven" } }, "nil" => nil })
|
177
186
|
end
|
178
187
|
|
179
188
|
it "should raise an exception if you overwrite a string with a hash" do
|
189
|
+
with_breadcrumb("one")
|
180
190
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
181
191
|
vivid.write("one", "two", "three", "four", "five")
|
182
192
|
expect(vivid).to eql({ "one" => { "two" => { "three" => { "four" => "five" } } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
183
193
|
end
|
184
194
|
|
185
195
|
it "should raise an exception if you traverse through a string with a hash" do
|
196
|
+
with_breadcrumb("one")
|
186
197
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
187
198
|
vivid.write("one", "two", "three", "four", "five", "six")
|
188
199
|
expect(vivid).to eql({ "one" => { "two" => { "three" => { "four" => { "five" => "six" } } } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
189
200
|
end
|
190
201
|
|
191
202
|
it "should raise an exception if you overwrite a nil with a hash" do
|
203
|
+
with_breadcrumb("nil")
|
192
204
|
expect(root).to receive(:reset_cache).at_least(:once).with("nil")
|
193
205
|
vivid.write("nil", "one", "two")
|
194
206
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => { "one" => "two" } })
|
195
207
|
end
|
196
208
|
|
197
209
|
it "should raise an exception if you traverse through a nil with a hash" do
|
210
|
+
with_breadcrumb("nil")
|
198
211
|
expect(root).to receive(:reset_cache).at_least(:once).with("nil")
|
199
212
|
vivid.write("nil", "one", "two", "three")
|
200
213
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => { "one" => { "two" => "three" } } })
|
201
214
|
end
|
202
215
|
|
203
216
|
it "writes with a block" do
|
217
|
+
with_breadcrumb("one")
|
204
218
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
205
219
|
vivid.write("one", "five") { "six" }
|
206
220
|
expect(vivid["one"]["five"]).to eql("six")
|
@@ -214,54 +228,63 @@ describe Chef::Node::VividMash do
|
|
214
228
|
end
|
215
229
|
|
216
230
|
it "should write into hashes" do
|
231
|
+
with_breadcrumb("one")
|
217
232
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
218
233
|
vivid.write!("one", "five", "six")
|
219
234
|
expect(vivid["one"]["five"]).to eql("six")
|
220
235
|
end
|
221
236
|
|
222
237
|
it "should deeply autovivify" do
|
238
|
+
with_breadcrumb("one")
|
223
239
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
224
240
|
vivid.write!("one", "five", "six", "seven", "eight", "nine", "ten")
|
225
241
|
expect(vivid["one"]["five"]["six"]["seven"]["eight"]["nine"]).to eql("ten")
|
226
242
|
end
|
227
243
|
|
228
244
|
it "should raise an exception if you overwrite an array with a hash" do
|
245
|
+
with_breadcrumb("array")
|
229
246
|
expect(root).not_to receive(:reset_cache)
|
230
247
|
expect { vivid.write!("array", "five", "six") }.to raise_error(Chef::Exceptions::AttributeTypeMismatch)
|
231
248
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
232
249
|
end
|
233
250
|
|
234
251
|
it "should raise an exception if you traverse through an array with a hash" do
|
252
|
+
with_breadcrumb("array")
|
235
253
|
expect(root).not_to receive(:reset_cache)
|
236
254
|
expect { vivid.write!("array", "five", "six", "seven") }.to raise_error(Chef::Exceptions::AttributeTypeMismatch)
|
237
255
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
238
256
|
end
|
239
257
|
|
240
258
|
it "should raise an exception if you overwrite a string with a hash" do
|
259
|
+
with_breadcrumb("one")
|
241
260
|
expect(root).not_to receive(:reset_cache)
|
242
261
|
expect { vivid.write!("one", "two", "three", "four", "five") }.to raise_error(Chef::Exceptions::AttributeTypeMismatch)
|
243
262
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
244
263
|
end
|
245
264
|
|
246
265
|
it "should raise an exception if you traverse through a string with a hash" do
|
266
|
+
with_breadcrumb("one")
|
247
267
|
expect(root).not_to receive(:reset_cache)
|
248
268
|
expect { vivid.write!("one", "two", "three", "four", "five", "six") }.to raise_error(Chef::Exceptions::AttributeTypeMismatch)
|
249
269
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
250
270
|
end
|
251
271
|
|
252
272
|
it "should raise an exception if you overwrite a nil with a hash" do
|
273
|
+
with_breadcrumb("nil")
|
253
274
|
expect(root).not_to receive(:reset_cache)
|
254
275
|
expect { vivid.write!("nil", "one", "two") }.to raise_error(Chef::Exceptions::AttributeTypeMismatch)
|
255
276
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
256
277
|
end
|
257
278
|
|
258
279
|
it "should raise an exception if you traverse through a nil with a hash" do
|
280
|
+
with_breadcrumb("nil")
|
259
281
|
expect(root).not_to receive(:reset_cache)
|
260
282
|
expect { vivid.write!("nil", "one", "two", "three") }.to raise_error(Chef::Exceptions::AttributeTypeMismatch)
|
261
283
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
262
284
|
end
|
263
285
|
|
264
286
|
it "writes with a block" do
|
287
|
+
with_breadcrumb("one")
|
265
288
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
266
289
|
vivid.write!("one", "five") { "six" }
|
267
290
|
expect(vivid["one"]["five"]).to eql("six")
|
@@ -274,31 +297,36 @@ describe Chef::Node::VividMash do
|
|
274
297
|
expect(root).not_to receive(:reset_cache).with(nil)
|
275
298
|
end
|
276
299
|
|
277
|
-
it "should return nil if the keys
|
300
|
+
it "should return nil if the keys don't already exist" do
|
301
|
+
expect(root).to receive(:top_level_breadcrumb=).with(nil).at_least(:once).and_call_original
|
278
302
|
expect(root).not_to receive(:reset_cache)
|
279
303
|
expect(vivid.unlink("five", "six", "seven", "eight")).to eql(nil)
|
280
304
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
281
305
|
end
|
282
306
|
|
283
307
|
it "should unlink hashes" do
|
308
|
+
with_breadcrumb("one")
|
284
309
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
285
310
|
expect( vivid.unlink("one") ).to eql({ "two" => { "three" => "four" } })
|
286
311
|
expect(vivid).to eql({ "array" => [ 0, 1, 2 ], "nil" => nil })
|
287
312
|
end
|
288
313
|
|
289
314
|
it "should unlink array elements" do
|
315
|
+
with_breadcrumb("array")
|
290
316
|
expect(root).to receive(:reset_cache).at_least(:once).with("array")
|
291
317
|
expect(vivid.unlink("array", 2)).to eql(2)
|
292
318
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1 ], "nil" => nil })
|
293
319
|
end
|
294
320
|
|
295
321
|
it "should unlink nil" do
|
322
|
+
with_breadcrumb("nil")
|
296
323
|
expect(root).to receive(:reset_cache).at_least(:once).with("nil")
|
297
324
|
expect(vivid.unlink("nil")).to eql(nil)
|
298
325
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ] })
|
299
326
|
end
|
300
327
|
|
301
328
|
it "should traverse a nil and safely do nothing" do
|
329
|
+
with_breadcrumb("nil")
|
302
330
|
expect(root).not_to receive(:reset_cache)
|
303
331
|
expect(vivid.unlink("nil", "foo")).to eql(nil)
|
304
332
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
@@ -311,31 +339,36 @@ describe Chef::Node::VividMash do
|
|
311
339
|
expect(root).not_to receive(:reset_cache).with(nil)
|
312
340
|
end
|
313
341
|
|
314
|
-
it "should raise an exception if the keys
|
342
|
+
it "should raise an exception if the keys don't already exist" do
|
343
|
+
expect(root).to receive(:top_level_breadcrumb=).with(nil).at_least(:once).and_call_original
|
315
344
|
expect(root).not_to receive(:reset_cache)
|
316
345
|
expect { vivid.unlink!("five", "six", "seven", "eight") }.to raise_error(Chef::Exceptions::NoSuchAttribute)
|
317
346
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
318
347
|
end
|
319
348
|
|
320
349
|
it "should unlink! hashes" do
|
350
|
+
with_breadcrumb("one")
|
321
351
|
expect(root).to receive(:reset_cache).at_least(:once).with("one")
|
322
352
|
expect( vivid.unlink!("one") ).to eql({ "two" => { "three" => "four" } })
|
323
353
|
expect(vivid).to eql({ "array" => [ 0, 1, 2 ], "nil" => nil })
|
324
354
|
end
|
325
355
|
|
326
356
|
it "should unlink! array elements" do
|
357
|
+
with_breadcrumb("array")
|
327
358
|
expect(root).to receive(:reset_cache).at_least(:once).with("array")
|
328
359
|
expect(vivid.unlink!("array", 2)).to eql(2)
|
329
360
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1 ], "nil" => nil })
|
330
361
|
end
|
331
362
|
|
332
363
|
it "should unlink! nil" do
|
364
|
+
with_breadcrumb("nil")
|
333
365
|
expect(root).to receive(:reset_cache).at_least(:once).with("nil")
|
334
366
|
expect(vivid.unlink!("nil")).to eql(nil)
|
335
367
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ] })
|
336
368
|
end
|
337
369
|
|
338
370
|
it "should raise an exception if it traverses a nil" do
|
371
|
+
with_breadcrumb("nil")
|
339
372
|
expect(root).not_to receive(:reset_cache)
|
340
373
|
expect { vivid.unlink!("nil", "foo") }.to raise_error(Chef::Exceptions::NoSuchAttribute)
|
341
374
|
expect(vivid).to eql({ "one" => { "two" => { "three" => "four" } }, "array" => [ 0, 1, 2 ], "nil" => nil })
|
data/spec/unit/node_spec.rb
CHANGED
@@ -357,6 +357,30 @@ describe Chef::Node do
|
|
357
357
|
node.default.fuu.bahrr.baz = "qux"
|
358
358
|
expect(node.fuu.bahrr.baz).to eq("qux")
|
359
359
|
end
|
360
|
+
|
361
|
+
it "default_unless correctly resets the deep merge cache" do
|
362
|
+
node.normal["tags"] = [] # this sets our top-level breadcrumb
|
363
|
+
node.default_unless["foo"]["bar"] = "NK-19V"
|
364
|
+
expect(node["foo"]["bar"]).to eql("NK-19V")
|
365
|
+
node.default_unless["foo"]["baz"] = "NK-33"
|
366
|
+
expect(node["foo"]["baz"]).to eql("NK-33")
|
367
|
+
end
|
368
|
+
|
369
|
+
it "normal_unless correctly resets the deep merge cache" do
|
370
|
+
node.normal["tags"] = [] # this sets our top-level breadcrumb
|
371
|
+
node.normal_unless["foo"]["bar"] = "NK-19V"
|
372
|
+
expect(node["foo"]["bar"]).to eql("NK-19V")
|
373
|
+
node.normal_unless["foo"]["baz"] = "NK-33"
|
374
|
+
expect(node["foo"]["baz"]).to eql("NK-33")
|
375
|
+
end
|
376
|
+
|
377
|
+
it "override_unless correctly resets the deep merge cache" do
|
378
|
+
node.normal["tags"] = [] # this sets our top-level breadcrumb
|
379
|
+
node.override_unless["foo"]["bar"] = "NK-19V"
|
380
|
+
expect(node["foo"]["bar"]).to eql("NK-19V")
|
381
|
+
node.override_unless["foo"]["baz"] = "NK-33"
|
382
|
+
expect(node["foo"]["baz"]).to eql("NK-33")
|
383
|
+
end
|
360
384
|
end
|
361
385
|
|
362
386
|
describe "override attributes" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.12.
|
4
|
+
version: 12.12.15
|
5
5
|
platform: universal-mingw32
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 12.12.
|
19
|
+
version: 12.12.15
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 12.12.
|
26
|
+
version: 12.12.15
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -2689,7 +2689,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2689
2689
|
version: '0'
|
2690
2690
|
requirements: []
|
2691
2691
|
rubyforge_project:
|
2692
|
-
rubygems_version: 2.6.
|
2692
|
+
rubygems_version: 2.6.6
|
2693
2693
|
signing_key:
|
2694
2694
|
specification_version: 4
|
2695
2695
|
summary: A systems integration framework, built to bring the benefits of configuration
|