Merge pull request #695 from PowerShell/NativeLinuxCommandsTest

Add Pester tests for calling native Linux commands for #138
This commit is contained in:
Andy Schwartzmeyer 2016-03-18 19:39:09 -07:00
commit 8313aaa418

View file

@ -0,0 +1,30 @@
Describe "NativeLinuxCommands" {
It "Should return a type of System.Object for hostname cmdlet" {
(hostname).GetType().BaseType | Should Be 'System.Object'
(hostname).GetType().Name | Should Be String
}
It "Should have not empty Name flags set for ps object" {
ps | foreach-object { $_.ProcessName | Should Not BeNullOrEmpty }
}
It "Should find Application grep" -Skip:$IsWindows {
(get-command grep).CommandType | Should Be Application
}
It "Should pipe to grep and get result" -Skip:$IsWindows {
"hello world" | grep hello | Should Be "hello world"
}
It "Should find Application touch" -Skip:$IsWindows {
(get-command touch).CommandType | Should Be Application
}
It "Should find Alias ls" -Skip:$IsWindows {
(get-command ls).CommandType | Should Be Alias
}
It "Should find Function mkdir" -Skip:$IsWindows {
(get-command mkdir).CommandType | Should Be Function
}
}