File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1- # Copyright 2016-2024 Cloudbase Solutions Srl
1+ # Copyright 2016-2024 Cloudbase Solutions Srl
22#
33# Licensed under the Apache License, Version 2.0 (the "License"); you may
44# not use this file except in compliance with the License. You may obtain
@@ -190,6 +190,22 @@ children:
190190 }
191191
192192 Describe " Test PSCustomObject wrapped values are serialized correctly" {
193+ Context " A PSCustomObject that contains an array of PSObjects" {
194+ It " Should serialize correctly" {
195+ $expected = @"
196+ yamlList:
197+ - item1
198+ - item2
199+
200+ "@
201+ $data = ConvertFrom-YAml " yamlList: []" | ConvertTo-JSON - Depth 3 | ConvertFrom-Json
202+ $jsData = ' ["item1", "item2"]'
203+ $data.yamlList = $jsData | ConvertFrom-Json
204+
205+ $asYaml = ConvertTo-Yaml $data
206+ Assert-Equivalent - Options $compareStrictly - Expected $expected - Actual $asYaml
207+ }
208+ }
193209 Context " A PSCustomObject containing nested PSCustomObjects" {
194210 It " Should serialize correctly" {
195211 $expectBigInt = [System.Numerics.BigInteger ]::Parse(" 9999999999999999999999999999999999999999999999999" )
You can’t perform that action at this time.
0 commit comments