fixed Get-ChildItem.Tests

This commit is contained in:
Zachary Folwick
2015-07-16 16:13:12 -07:00
parent c8a6f4d783
commit 3d47638e5c
+15 -29
View File
@@ -3,34 +3,20 @@ $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "Test-Get-ChildItem" {
Context ": non-aliased testing" {
It "Should list the contents of the current folder" {
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
}
It "Should list the contents of the home directory" {
pushd $HOME
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
popd
}
It "Should list the contents of the current folder" {
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
(ls .).Name.Length | Should BeGreaterThan 0
}
It "Should list the contents of the home directory" {
pushd /usr/
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
popd
pushd /usr/
(ls .).Name.Length | Should BeGreaterThan 0
popd
}
Context ": alias tests" {
It "Should list the contents of the current folder" {
(ls).Name.Length | Should BeGreaterThan 0
}
It "Should list the contents of the home directory" {
pushd $HOME
(ls).Name.Length | Should BeGreaterThan 0
popd
}
It "Should list the contents of environment variables" {
(ls ENV:).Count | Should BeGreaterThan 10
(ls ENV:os).Value | Should Be (Get-ChildItem ENV:os).Value
(ls ENV:PROCESSOR_ARCHITECTURE).Value | Should Be (Get-ChildItem ENV:PROCESSOR_ARCHITECTURE).Value
(ls ENV:OS).Value | Should Be $env:OS
}
}
}
}