forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGet-PSDrive.Tests.ps1
More file actions
56 lines (46 loc) · 1.62 KB
/
Copy pathGet-PSDrive.Tests.ps1
File metadata and controls
56 lines (46 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Describe "Get-PSDrive" -Tags "CI" {
It "Should not throw" {
Get-PSDrive | Should Not BeNullOrEmpty
}
It "Should have a name and a length property" {
(Get-PSDrive).Name | Should Not BeNullOrEmpty
(Get-PSDrive).Root.Length | Should Not BeLessThan 1
}
It "Should be able to be called with the gdr alias" {
{ gdr } | Should Not Throw
gdr | Should Not BeNullOrEmpty
}
It "Should be the same output between Get-PSDrive and gdr" {
$alias = gdr
$actual = Get-PSDrive
$alias | Should Be $actual
}
It "Should return drive info"{
(Get-PSDrive Env).Name | Should Be Env
(Get-PSDrive Alias).Name | Should Be Alias
if ($IsWindows)
{
(Get-PSDrive Cert).Root | Should Be \
(Get-PSDrive C).Provider.Name | Should Be FileSystem
}
else
{
(Get-PSDrive /).Provider.Name | Should Be FileSystem
}
}
It "Should be able to access a drive using the PSProvider switch" {
(Get-PSDrive -PSProvider FileSystem).Name.Length | Should BeGreaterThan 0
}
It "Should return true that a drive that does not exist"{
!(Get-PSDrive fake -ErrorAction SilentlyContinue) | Should Be $True
Get-PSDrive fake -ErrorAction SilentlyContinue | Should BeNullOrEmpty
}
It "Should be able to determine the amount of free space of a drive" {
$dInfo = Get-PSDrive TESTDRIVE
$dInfo.Free -ge 0 | Should be $true
}
It "Should be able to determine the amount of Used space of a drive" {
$dInfo = Get-PSDrive TESTDRIVE
$dInfo.Used -ge 0 | Should be $true
}
}