Skip to content

Commit c23e3b6

Browse files
ryanhockstadmattfarina
authored andcommitted
Add test case for removing an entire object
Signed-off-by: Ryan Hockstad <[email protected]> (cherry picked from commit ef2eb55)
1 parent 3110d5f commit c23e3b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/chartutil/coalesce_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pequod:
5757
nested:
5858
foo: true
5959
boat: null
60+
object: null
6061
`)
6162

6263
func withDeps(c *chart.Chart, deps ...*chart.Chart) *chart.Chart {
@@ -118,6 +119,7 @@ func TestCoalesceValues(t *testing.T) {
118119
"name": "ahab",
119120
"boat": true,
120121
"nested": map[string]interface{}{"foo": false, "boat": true},
122+
"object": map[string]interface{}{"foo": "bar"},
121123
},
122124
},
123125
),
@@ -227,6 +229,10 @@ func TestCoalesceValues(t *testing.T) {
227229
t.Error("Expected sub-subchart nested boat key to be removed, still present")
228230
}
229231

232+
if _, ok := subsubchart["object"]; ok {
233+
t.Error("Expected sub-subchart object map to be removed, still present")
234+
}
235+
230236
// CoalesceValues should not mutate the passed arguments
231237
is.Equal(valsCopy, vals)
232238
}

0 commit comments

Comments
 (0)