Fixed the CR issue
This commit is contained in:
parent
dbd2a8f1b1
commit
10144d7c55
2 changed files with 22 additions and 28 deletions
|
@ -2,22 +2,22 @@ Describe "Update-FormatData" {
|
||||||
|
|
||||||
Context "Validate Update-FormatData update correctly" {
|
Context "Validate Update-FormatData update correctly" {
|
||||||
|
|
||||||
It "Should not throw upon reloading previous formatting file" {
|
It "Should not throw upon reloading previous formatting file" {
|
||||||
{ Update-FormatData } | Should Not throw
|
{ Update-FormatData } | Should Not throw
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should validly load formatting data" {
|
It "Should validly load formatting data" {
|
||||||
{ Get-FormatData -typename System.Diagnostics.Process | Export-FormatData -Path "outputfile.ps1xml" }
|
$path = Join-Path -Path $TestDrive -ChildPath "outputfile.ps1xml"
|
||||||
{ Update-FormatData -prependPath "outputfile.ps1xml" | Should Not throw }
|
Get-FormatData -typename System.Diagnostics.Process | Export-FormatData -Path $path
|
||||||
{ Remove-Item "outputfile.ps1xml" -ErrorAction SilentlyContinue }
|
{ Update-FormatData -prependPath $path } | Should Not throw
|
||||||
}
|
Remove-Item $path -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Update-FormatData basic functionality" -Tags DRT{
|
Describe "Update-FormatData basic functionality" -Tags DRT{
|
||||||
$tmpDirectory = $TestDrive
|
|
||||||
$testfilename = "testfile.ps1xml"
|
$testfilename = "testfile.ps1xml"
|
||||||
$testfile = Join-Path -Path $tmpDirectory -ChildPath $testfilename
|
$testfile = Join-Path -Path $TestDrive -ChildPath $testfilename
|
||||||
|
|
||||||
It "Update-FormatData with WhatIf should work"{
|
It "Update-FormatData with WhatIf should work"{
|
||||||
$xmlContent=@"
|
$xmlContent=@"
|
||||||
|
@ -36,15 +36,15 @@ Describe "Update-FormatData basic functionality" -Tags DRT{
|
||||||
</Type>
|
</Type>
|
||||||
</Types>
|
</Types>
|
||||||
"@
|
"@
|
||||||
$xmlContent>$testfile
|
$xmlContent > $testfile
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
{Update-FormatData -Append $testfile -WhatIf} | Should Not Throw
|
{ Update-FormatData -Append $testfile -WhatIf } | Should Not Throw
|
||||||
{Update-FormatData -Prepend $testfile -WhatIf} | Should Not Throw
|
{ Update-FormatData -Prepend $testfile -WhatIf } | Should Not Throw
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
rm $testfile
|
Remove-Item $testfile -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,15 +2,9 @@ Describe "Update-TypeData" {
|
||||||
|
|
||||||
Context "Validate Update-Type updates correctly" {
|
Context "Validate Update-Type updates correctly" {
|
||||||
|
|
||||||
It "Should not throw upon reloading previous formatting file" {
|
It "Should not throw upon reloading previous formatting file" {
|
||||||
{ Update-TypeData } | Should Not throw
|
{ Update-TypeData } | Should Not throw
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should validly load formatting data" {
|
|
||||||
{ Get-TypeData -typename System.Diagnostics.Process | Export-TypeData -Path "outputfile.ps1xml" }
|
|
||||||
{ Update-TypeData -prependPath "outputfile.ps1xml" | Should Not throw }
|
|
||||||
{ Remove-Item "outputfile.ps1xml" -ErrorAction SilentlyContinue }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +56,7 @@ Describe "Update-TypeData basic functionality" -Tags DRT{
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Remove-TypeData -Path $testfile
|
Remove-TypeData -Path $testfile
|
||||||
rm $testfile
|
Remove-Item $testfile -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +76,7 @@ Describe "Update-TypeData basic functionality" -Tags DRT{
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
rm $invalidFileExtensionFile
|
Remove-Item $invalidFileExtensionFile -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +99,8 @@ Describe "Update-TypeData basic functionality" -Tags DRT{
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Remove-TypeData -Path $filelist
|
Remove-TypeData -Path $filelist
|
||||||
rm $invalidFileExtensionFile
|
Remove-Item $invalidFileExtensionFile -ErrorAction SilentlyContinue
|
||||||
rm $filelist
|
Remove-Item $filelist -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,7 +353,7 @@ Describe "Update-TypeData basic functionality" -Tags DRT{
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Remove-TypeData -Path $testfile
|
Remove-TypeData -Path $testfile
|
||||||
rm $testfile
|
Remove-Item $testfile -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue