@@ -8,12 +8,13 @@ Describe "OperationValidation Module Tests" {
8
8
{
9
9
$env: psmodulepath += " ;$moduleDir "
10
10
}
11
+ Remove-Module Microsoft.PowerShell.Operation.Validation - Force - ErrorAction SilentlyContinue
11
12
Import-Module OperationValidation - Force
12
13
$Commands = Get-Command - module OperationValidation| sort-object Name
13
14
}
14
15
AfterAll {
15
16
$env: PSModulePath = $SavedModulePath
16
- remove -Module OperationValidation
17
+ Remove -Module OperationValidation
17
18
}
18
19
It " Module has been loaded" {
19
20
Get-Module OperationValidation | should not BeNullOrEmpty
@@ -86,13 +87,19 @@ Describe "OperationValidation Module Tests" {
86
87
$tests.File | should be WindowsSearch.Simple.Tests.ps1
87
88
}
88
89
It " Can find a specific version of a module" {
89
- $tests = Get-OperationValidation - ModuleName ' VersionedModule' - Version ' 1.0.0'
90
- $tests.Count | Should be 1
91
- $tests.File | Should be ' PSGallery.Simple.Tests.ps1'
90
+ $v1Tests = @ (Get-OperationValidation - ModuleName ' VersionedModule' - Version ' 1.0.0' )
91
+ $v1Tests.Count | Should be 1
92
+ $v1Tests.File | Should be ' PSGallery.Simple.Tests.ps1'
93
+
94
+ $v2Tests = @ (Get-OperationValidation - ModuleName ' VersionedModule' - Version ' 2.0.0' )
95
+ $v2Tests.Count | Should be 2
96
+ $v2Tests [0 ].File | Should be ' PSGallery.Simple.Tests.ps1'
97
+ $v2Tests [1 ].File | Should be ' PSGallery.Simple.Tests.ps1'
92
98
}
93
99
It " Can get the latest version of a module if no version is specified" {
94
100
$tests = Get-OperationValidation - ModuleName VersionedModule
95
- $tests.Version | Should be ([Version ]' 2.0.0' )
101
+ $tests [0 ].Version | Should be ([Version ]' 2.0.0' )
102
+ $tests [1 ].Version | Should be ([Version ]' 2.0.0' )
96
103
}
97
104
It " Formats the output appropriately" {
98
105
$output = Get-OperationValidation - modulename OperationValidation | out-string - str - width 210 | ? {$_ }
0 commit comments