$xml.$rootElement.Element | Should -Be '1', '2', '3', '4', '5' Fails because $RootElement is still 'documentRoot' from previous test
Context "The Problematic Assertions"
It 'can expand arrays in a similar way to PowerShell' {
# If a document contains an array it can be expanded in a similar manner to any other PowerShell object.
$xml = [Xml]@'
<root>
<element>1</element>
<element>2</element>
<element>3</element>
<element>4</element>
<element>5</element>
</root>
'@
$xml.$rootElement.Element | Should -Be '1', '2', '3', '4', '5'
}
Context "Your Attempts"
replacing $xml.$RootElement.Element with $xml.root.Element works
Describe "Koan Bug, Issue, or Help Request"
$xml.$rootElement.Element | Should -Be '1', '2', '3', '4', '5'
Fails because$RootElement
is still'documentRoot'
from previous testContext "The Problematic Assertions"
Context "Your Attempts"
replacing
$xml.$RootElement.Element
with$xml.root.Element
worksContext "Additional Information"
PR incoming