Fixed the CR issue

This commit is contained in:
TingLiu6 authored and JumpingYang001 committed 2016-05-16 19:52:47 -07:00
1 parent dbd2a8f1b1
commit 10144d7c55
2 files changed
+22 -28

No files matched your search

+14 -14
View File
@@ -2,22 +2,22 @@ Describe "Update-FormatData" {
Context "Validate Update-FormatData update correctly" {
It "Should not throw upon reloading previous formatting file" {
{ Update-FormatData } | Should Not throw
}
It "Should not throw upon reloading previous formatting file" {
{ Update-FormatData } | Should Not throw
}
It "Should validly load formatting data" {
{ Get-FormatData -typename System.Diagnostics.Process | Export-FormatData -Path "outputfile.ps1xml" }
{ Update-FormatData -prependPath "outputfile.ps1xml" | Should Not throw }
{ Remove-Item "outputfile.ps1xml" -ErrorAction SilentlyContinue }
}
It "Should validly load formatting data" {
$path = Join-Path -Path $TestDrive -ChildPath "outputfile.ps1xml"
Get-FormatData -typename System.Diagnostics.Process | Export-FormatData -Path $path
{ Update-FormatData -prependPath $path } | Should Not throw
Remove-Item $path -ErrorAction SilentlyContinue
}
}
}
Describe "Update-FormatData basic functionality" -Tags DRT{
$tmpDirectory = $TestDrive
$testfilename = "testfile.ps1xml"
$testfile = Join-Path -Path $tmpDirectory -ChildPath $testfilename
$testfile = Join-Path -Path $TestDrive -ChildPath $testfilename
It "Update-FormatData with WhatIf should work"{
$xmlContent=@"
@@ -36,15 +36,15 @@ Describe "Update-FormatData basic functionality" -Tags DRT{
</Type>
</Types>
"@
$xmlContent>$testfile
$xmlContent > $testfile
try
{
{Update-FormatData -Append $testfile -WhatIf} | Should Not Throw
{Update-FormatData -Prepend $testfile -WhatIf} | Should Not Throw
{ Update-FormatData -Append $testfile -WhatIf } | Should Not Throw
{ Update-FormatData -Prepend $testfile -WhatIf } | Should Not Throw
}
finally
{
rm $testfile
Remove-Item $testfile -ErrorAction SilentlyContinue
}
}
}