mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add tests for command name matching
This commit is contained in:
@@ -16,3 +16,24 @@ Describe "NativeLinuxCommands" {
|
||||
(get-command touch).CommandType | Should Be Application
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Scripts with extensions" {
|
||||
BeforeAll {
|
||||
$data = "Hello World"
|
||||
Setup -File testScript.ps1 -Content "'$data'"
|
||||
$originalPath = $env:PATH
|
||||
$env:PATH += [IO.Path]::PathSeparator + $TestDrive
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$env:PATH = $originalPath
|
||||
}
|
||||
|
||||
It "Should run a script with its full name" {
|
||||
testScript.ps1 | Should Be $data
|
||||
}
|
||||
|
||||
It "Should run a script with its short name" {
|
||||
testScript | Should Be $data
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user