PowerShell7/test/powershell/Write-Host.Tests.ps1

22 lines
738 B
PowerShell
Raw Normal View History

2016-05-10 07:33:33 +00:00
Describe "Write-Host DRT Unit Tests" -Tags DRT{
$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" }
)
2016-05-25 06:01:22 +00:00
It "write-Host works with '<Name>' switch" -TestCases $testData -Pending:$IsOSX {
2016-05-10 07:33:33 +00:00
param($Command, $returnValue)
2016-05-25 06:01:22 +00:00
If($IsLinux)
2016-05-10 07:33:33 +00:00
{
$content = powershell -noprofile -command $Command
2016-05-10 07:33:33 +00:00
}
2016-05-25 06:01:22 +00:00
If ($IsWindows)
2016-05-10 07:33:33 +00:00
{
$content = powershell.exe -noprofile -command $Command
2016-05-10 07:33:33 +00:00
}
2016-05-10 07:33:33 +00:00
$content | Should Be $returnValue
}
}