Files
PowerShell/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1
T

39 lines
1.1 KiB
PowerShell
Raw Normal View History

2016-07-25 14:01:41 -07:00
Describe "NativeLinuxCommands" -tags "CI" {
It "Should return a type of System.Object for hostname cmdlet" {
2016-04-08 13:36:54 -07:00
(hostname).GetType().BaseType | Should Be 'System.Object'
(hostname).GetType().Name | Should Be String
}
2016-04-08 13:36:54 -07:00
It "Should find Application grep" -Skip:$IsWindows {
(get-command grep).CommandType | Should Be Application
}
It "Should pipe to grep and get result" -Skip:$IsWindows {
2016-04-08 13:36:54 -07:00
"hello world" | grep hello | Should Be "hello world"
}
2016-04-08 13:36:54 -07:00
It "Should find Application touch" -Skip:$IsWindows {
(get-command touch).CommandType | Should Be Application
}
}
2016-05-27 11:43:05 -07:00
2016-07-25 14:01:41 -07:00
Describe "Scripts with extensions" -tags "CI" {
2016-05-27 11:43:05 -07:00
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
}
}