Fix Write-Host tests
These were not testing the development build of PowerShell.
This commit is contained in:
parent
fe56aaafa7
commit
2dd01a9d31
1 changed files with 11 additions and 15 deletions
|
@ -1,4 +1,10 @@
|
|||
Describe "Write-Host DRT Unit Tests" -Tags DRT{
|
||||
Describe "Write-Host DRT Unit Tests" -Tags DRT {
|
||||
|
||||
BeforeAll {
|
||||
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
|
||||
}
|
||||
|
||||
|
||||
$testData = @(
|
||||
@{ Name = 'NoNewline';Command = "Write-Host a,b -Separator ',' -ForegroundColor Yellow -BackgroundColor DarkBlue -NoNewline"; returnValue = "a,b" }
|
||||
@{ Name = 'Separator';Command = "Write-Host a,b,c -Separator '+'"; returnValue = "a+b+c" }
|
||||
|
@ -7,16 +13,6 @@
|
|||
It "write-Host works with '<Name>' switch" -TestCases $testData -Pending:$IsOSX {
|
||||
param($Command, $returnValue)
|
||||
|
||||
If($IsLinux)
|
||||
{
|
||||
$content = powershell -noprofile -command $Command
|
||||
}
|
||||
|
||||
If ($IsWindows)
|
||||
{
|
||||
$content = powershell.exe -noprofile -command $Command
|
||||
}
|
||||
|
||||
$content | Should Be $returnValue
|
||||
& $powershell -noprofile $Command | Should Be $returnValue
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue