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,22 +1,18 @@
|
||||||
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 = @(
|
$testData = @(
|
||||||
@{ Name = 'NoNewline';Command = "Write-Host a,b -Separator ',' -ForegroundColor Yellow -BackgroundColor DarkBlue -NoNewline"; returnValue = "a,b" }
|
@{ 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" }
|
@{ Name = 'Separator';Command = "Write-Host a,b,c -Separator '+'"; returnValue = "a+b+c" }
|
||||||
)
|
)
|
||||||
|
|
||||||
It "write-Host works with '<Name>' switch" -TestCases $testData -Pending:$IsOSX {
|
|
||||||
param($Command, $returnValue)
|
|
||||||
|
|
||||||
If($IsLinux)
|
It "write-Host works with '<Name>' switch" -TestCases $testData -Pending:$IsOSX {
|
||||||
{
|
param($Command, $returnValue)
|
||||||
$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