mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Added testcase for validating invalid filepath scenario. (#1749)
This commit is contained in:
1 parent
6526968947
commit
d2feb51132
1 file changed
+8
@@ -96,4 +96,12 @@ Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" {
|
||||
$expectedError = "CannotStartTranscription,Microsoft.PowerShell.Commands.StartTranscriptCommand"
|
||||
ValidateTranscription -scriptToExecute $script -outputFilePath $null -expectedError $expectedError
|
||||
}
|
||||
It "Should return an error if file path is invalid" {
|
||||
$fileName = (Get-Random).ToString()
|
||||
$inputPath = join-path $TestDrive $fileName
|
||||
$null = New-Item -Path $inputPath -ItemType File -Force -ErrorAction SilentlyContinue
|
||||
$script = "Start-Transcript -OutputDirectory $inputPath"
|
||||
$expectedError = "CannotStartTranscription,Microsoft.PowerShell.Commands.StartTranscriptCommand"
|
||||
ValidateTranscription -scriptToExecute $script -outputFilePath $null -expectedError $expectedError
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user