Files
PowerShell/test/powershell/Get-Item.Tests.ps1
T
Andrew Schwartzmeyer 62de9f2645 Fix the Get-Item Pester test
Failed because we renamed the test directory.
2016-01-15 14:31:52 -08:00

23 lines
918 B
PowerShell

$here = Split-Path -Parent $MyInvocation.MyCommand.Path
Describe "Get-Item" {
It "Should list all the items in the current working directory when asterisk is used" {
(Get-Item $here/*).GetType().BaseType | Should Be 'array'
(Get-Item $here/*).GetType().Name | Should Be 'Object[]'
}
It "Should return the name of the current working directory when a dot is used" {
(Get-Item $here).GetType().BaseType | Should Be 'System.IO.FileSystemInfo'
(Get-Item $here).Name | Should Be 'powershell'
}
It "Should return the proper Name and BaseType for directory objects vs file system objects" {
(Get-Item $here).GetType().Name | Should Be 'DirectoryInfo'
(Get-Item $here/Get-Item.Tests.ps1).GetType().Name | Should Be 'FileInfo'
}
It "Should have mode flags set" {
ls $here | foreach-object { $_.Mode | Should Not BeNullOrEmpty }
}
}