2016-07-26 02:43:28 +02:00
|
|
|
Describe "Read-Host" -Tags "Slow","Feature" {
|
2016-07-07 23:46:14 +02:00
|
|
|
Context "[Console]::ReadKey() implementation on non-Windows" {
|
|
|
|
BeforeAll {
|
2017-10-18 02:25:11 +02:00
|
|
|
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
|
2016-07-07 23:46:14 +02:00
|
|
|
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
|
|
|
|
if ($IsWindows) {
|
|
|
|
$ItArgs = @{ skip = $true }
|
|
|
|
} elseif (-not (Get-Command expect -ErrorAction Ignore)) {
|
|
|
|
$ItArgs = @{ pending = $true }
|
|
|
|
} else {
|
|
|
|
$ItArgs = @{ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
It @ItArgs "Should output correctly" {
|
|
|
|
& (Join-Path $assetsDir "Read-Host.Output.expect") $powershell | Out-Null
|
|
|
|
$LASTEXITCODE | Should Be 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|