PowerShell/test/powershell/Get-ChildItem.Tests.ps1

26 lines
752 B
PowerShell
Raw Normal View History

2015-10-23 01:35:31 +02:00
Describe "Get-ChildItem" {
2015-07-17 01:13:12 +02:00
It "Should list the contents of the current folder" {
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
2015-07-15 19:15:39 +02:00
}
2015-07-17 01:13:12 +02:00
It "Should list the contents of the home directory" {
pushd $HOME
2015-07-17 01:13:12 +02:00
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
popd
2015-12-28 19:15:19 +01:00
}
2015-07-17 01:13:12 +02:00
2015-12-28 19:15:19 +01:00
It "Should be able to use the ls alias" {
$(ls .).Name.Length | Should Be $(Get-ChildItem .).Name.Length
2015-07-15 19:15:39 +02:00
}
It "Should have a the proper fields and be populated" {
$var = Get-Childitem .
$var.Name.Length | Should BeGreaterThan 0
$var.Mode.Length | Should BeGreaterThan 0
$var.LastWriteTime | Should BeGreaterThan 0
$var.Length.Length | Should BeGreaterThan 0
}
2015-07-17 01:13:12 +02:00
}