Fix Write-Host tests

These were not testing the development build of PowerShell.
This commit is contained in:
Andrew Schwartzmeyer 2016-06-29 14:39:41 -07:00
parent fe56aaafa7
commit 2dd01a9d31

View file

@ -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 = @(
@{ 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" }
)
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
}
It "write-Host works with '<Name>' switch" -TestCases $testData -Pending:$IsOSX {
param($Command, $returnValue)
$content | Should Be $returnValue
& $powershell -noprofile $Command | Should Be $returnValue
}
}
}