Skip to content

Commit

Permalink
attempting to fix ConvertTo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pezhore committed Jul 19, 2017
1 parent af43570 commit 0490731
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions Tests/PSYaml.ConvertTo.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ $libPath = "$($PSScriptRoot)\..\$($ModuleName)\lib\YamlDotNet.dll"
Add-Type -Path $libPath

$YamlText = @"
anArray:
- 1
- 2
Expand All @@ -22,7 +21,6 @@ $YamlText = @"
- 'an'
- 'array'
hello: 'world'
"@

$PSObj = ConvertFrom-Yaml $YamlText
Expand All @@ -43,7 +41,12 @@ if ($PSVersion -ne 5)

It 'Should convert yaml back to PSObject' {
$ConvertedObj = $Yaml | ConvertFrom-Yaml
$ConvertedObj | Should match $PSObj
$Output = Foreach ($Key in $ConvertedObj.Keys)
{
Compare-Object $ConvertedObj.$Key $PSObj.$Key
}

$Output | Should be $null
}
}
}
Expand All @@ -62,7 +65,12 @@ Describe "Should convert a PSObject to YAML in PowerShell v5" {

It 'Should convert yaml back to PSObject' {
$ConvertedObj = $Yaml | ConvertFrom-Yaml
$ConvertedObj | Should match $PSObj
$Output = Foreach ($Key in $ConvertedObj.Keys)
{
Compare-Object $ConvertedObj.$Key $PSObj.$Key
}

$Output | Should be $null
}
}
}
Expand All @@ -80,7 +88,12 @@ Describe "Should convert a PSObject to YAML in PowerShell v4" {

It 'Should convert yaml back to PSObject' {
$ConvertedObj = $Yaml | ConvertFrom-Yaml
$ConvertedObj | Should match $PSObj
$Output = Foreach ($Key in $ConvertedObj.Keys)
{
Compare-Object $ConvertedObj.$Key $PSObj.$Key
}

$Output | Should be $null
}
}
}
Expand All @@ -98,7 +111,12 @@ Describe "Should convert a PSObject to YAML in PowerShell v3" {

It 'Should convert yaml back to PSObject' {
$ConvertedObj = $Yaml | ConvertFrom-Yaml
$ConvertedObj | Should match $PSObj
$Output = Foreach ($Key in $ConvertedObj.Keys)
{
Compare-Object $ConvertedObj.$Key $PSObj.$Key
}

$Output | Should be $null
}
}
}
Expand All @@ -116,7 +134,12 @@ Describe "Should convert a PSObject to YAML in PowerShell v2" {

It 'Should convert yaml back to PSObject' {
$ConvertedObj = $Yaml | ConvertFrom-Yaml
$ConvertedObj | Should match $PSObj
$Output = Foreach ($Key in $ConvertedObj.Keys)
{
Compare-Object $ConvertedObj.$Key $PSObj.$Key
}

$Output | Should be $null
}
}
}

0 comments on commit 0490731

Please sign in to comment.