Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 06b1cb5

Browse files
committed
Add versioned module tests
1 parent eea6ac5 commit 06b1cb5

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

Modules/OperationValidation/Test/OperationValidation.Tests.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ Describe "OperationValidation Module Tests" {
8585
@($tests).Count | Should be 1
8686
$tests.File | should be WindowsSearch.Simple.Tests.ps1
8787
}
88+
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'
92+
}
93+
It "Can get the latest version of a module if no version is specified" {
94+
$tests = Get-OperationValidation -ModuleName VersionedModule
95+
$tests.Version | Should be [Version]'2.0.0'
96+
}
8897
It "Formats the output appropriately" {
8998
$output = Get-OperationValidation -modulename OperationValidation | out-string -str -width 210|?{$_}
9099
$expected = ".*Module: .*OperationValidation",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Describe 'Simple Validation of PSGallery' {
2+
It 'The PowerShell Gallery should be responsive' {
3+
$request = [System.Net.WebRequest]::Create('https://www.powershellgallery.com')
4+
$response = $Request.GetResponse()
5+
$response.StatusCode | Should be OK
6+
}
7+
}
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Describe 'Simple Validation of PSGallery' {
2+
It 'The PowerShell Gallery should be responsive' {
3+
$request = [System.Net.WebRequest]::Create('https://www.powershellgallery.com')
4+
$response = $Request.GetResponse()
5+
$response.StatusCode | Should be OK
6+
}
7+
}
8+
9+
Describe 'Simple Validation of Microsoft' {
10+
It 'Microsoft should be responsive' {
11+
$request = [System.Net.WebRequest]::Create('https://www.microsoft.com')
12+
$response = $Request.GetResponse()
13+
$response.StatusCode | Should be OK
14+
}
15+
}
Binary file not shown.

0 commit comments

Comments
 (0)