Add error stream and information stream tests

for native pipes
This commit is contained in:
Sergei Vorobev
2016-11-15 14:49:39 -08:00
parent b93042670f
commit 6acc1e0629
@@ -10,9 +10,22 @@ Describe 'minishell for native executables' -Tag 'CI' {
}
It 'gets a hashtable object from minishell' {
$output = & powershell { @{'a' = 'b'} }
$output = & $powershell { @{'a' = 'b'} }
($output | measure).Count | Should Be 1
($output.GetType().Name) | Should Be 'Hashtable'
$output['a'] | Should Be 'b'
}
It 'gets the error stream from minishell' {
$output = & $powershell { Write-Error 'foo' } 2>&1
($output | measure).Count | Should Be 1
($output.GetType().Name) | Should Be 'ErrorRecord'
$output.FullyQualifiedErrorId | Should Be 'Microsoft.PowerShell.Commands.WriteErrorException'
}
It 'gets the information stream from minishell' {
$output = & $powershell { Write-Information 'foo' } 6>&1
($output.GetType().Name) | Should Be 'InformationRecord'
$output | Should Be 'foo'
}
}