-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdempotion.tests.ps1
37 lines (29 loc) · 1.02 KB
/
Idempotion.tests.ps1
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
$modulePath = $PSScriptRoot
$moduleName = $modulePath | Split-Path -Leaf
Describe 'Idempotion Module' -Tags Root {
Context "Manifest Destinies" {
$Script:manifest = $null
It 'has a valid manifest' {
{
$Script:manifest = Test-ModuleManifest -Path "$modulePath\$moduleName.psd1" -ErrorAction Stop
} | Should Not Throw
}
It 'has the right name' {
$Script:manifest.Name | Should Be $moduleName
}
It 'has a valid version' {
$Script:manifest.Version -as [version] | Should Not BeNullOrEmpty
}
}
Context "Loading $moduleName" {
$Error.Clear()
$Global:TestModule = Import-Module -Name $modulePath -Force -PassThru -ErrorAction SilentlyContinue
$errorAfter = $Error.Clone()
It 'loaded successfully' {
$Global:TestModule | Should Not BeNullOrEmpty
}
It 'raised no non-terminating errors' {
$errorAfter.Count | Should Be 0
}
}
}