Skip to content

Commit 1a16be0

Browse files
committed
Fix typos and improve consistency in formatting across multiple test files
1 parent c8d61c9 commit 1a16be0

10 files changed

Lines changed: 69 additions & 69 deletions

File tree

test/GetInstalledPSResource/GetInstalledPSResource.Tests.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Describe 'Test Get-InstalledPSResource for Module' -tags 'CI' {
5454
$pkgs.Name | Should -Contain $testModuleName
5555
}
5656

57-
$testCases =
57+
$testCases =
5858
@{Version="[1.0.0.0]"; ExpectedVersion="1.0.0.0"; Reason="validate version, exact match"},
5959
@{Version="1.0.0.0"; ExpectedVersion="1.0.0.0"; Reason="validate version, exact match without bracket syntax"},
6060
@{Version="[1.0.0.0, 5.0.0.0]"; ExpectedVersion=@("5.0.0.0", "3.0.0.0", "1.0.0.0"); Reason="validate version, exact range inclusive"},
@@ -73,10 +73,10 @@ $testCases =
7373
}
7474

7575
It "Throw invalid version error when passing incorrectly formatted version such as <Description>" -TestCases @(
76-
@{Version='[1.*.0]'; Description="version with wilcard in middle"},
77-
@{Version='[*.0.0.0]'; Description="version with wilcard at start"},
76+
@{Version='[1.*.0]'; Description="version with wildcard in middle"},
77+
@{Version='[*.0.0.0]'; Description="version with wildcard at start"},
7878
@{Version='[1.*.0.0]'; Description="version with wildcard at second digit"},
79-
@{Version='[1.0.*.0]'; Description="version with wildcard at third digit"}
79+
@{Version='[1.0.*.0]'; Description="version with wildcard at third digit"},
8080
@{Version='[1.0.0.*'; Description="version with wildcard at end"},
8181
@{Version='[1..0.0]'; Description="version with missing digit in middle"},
8282
@{Version='[1.0.0.]'; Description="version with missing digit at end"},
@@ -89,13 +89,13 @@ $testCases =
8989
$res = Find-PSResource -Name $testModuleName -Version $Version -Repository $PSGalleryName -ErrorAction Ignore
9090
}
9191
catch {}
92-
92+
9393
$res | Should -BeNullOrEmpty
9494
}
9595

9696
# These versions technically parse into proper NuGet versions, but will not return the version expected
9797
It "Does not return resource when passing incorrectly formatted version such as <Description>, does not throw error" -TestCases @(
98-
@{Version='(1.0.0.0)'; Description="exlcusive version (8.1.0.0)"},
98+
@{Version='(1.0.0.0)'; Description="exclusive version (8.1.0.0)"},
9999
@{Version='[1-0-0-0]'; Description="version formatted with invalid delimiter"}
100100

101101
) {
@@ -106,7 +106,7 @@ $testCases =
106106
$res = Find-PSResource -Name $testModuleName -Version $Version -Repository $PSGalleryName -ErrorAction Ignore
107107
}
108108
catch {}
109-
109+
110110
$res | Should -BeNullOrEmpty
111111
}
112112

@@ -181,4 +181,4 @@ $testCases =
181181
$pkg.Name | Should -contain "testmodule99"
182182
$pkg.InstalledLocation.ToString().Contains("/.local") | Should -Be $true
183183
}
184-
}
184+
}

test/InstallPSResourceTests/InstallPSResourceRepositorySearching.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Describe 'Test Install-PSResource for searching and looping through repositories
3434
Get-RevertPSResourceRepositoryFile
3535
}
3636

37-
It "install resources from higest priority repository where it exists (without -Repository specified)" {
37+
It "install resources from highest priority repository where it exists (without -Repository specified)" {
3838
# Package "test_module" exists in the following repositories (in this order): localRepo, PSGallery, NuGetGallery
3939
$res = Install-PSResource -Name $testModuleName -TrustRepository -SkipDependencyCheck -ErrorVariable err -ErrorAction SilentlyContinue -PassThru
4040
$err | Should -HaveCount 0

test/PSResourceInfo.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Describe "Write PSGetModuleInfo xml file" -tags 'CI' {
4040
{ [Microsoft.PowerShell.PSResourceGet.UtilClasses.TestHooks]::WritePSGetResourceInfo($fileToWrite, $psGetInfo) } | Should -Not -Throw
4141
}
4242

43-
It "Verifes written file can be read successfully" {
43+
It "Verifies written file can be read successfully" {
4444
$newGetInfo = [Microsoft.PowerShell.PSResourceGet.UtilClasses.TestHooks]::ReadPSGetResourceInfo($fileToWrite)
4545
CheckForExpectedPSGetInfo $newGetInfo
4646
}

test/PSScriptFileInfoTests/TestPSScriptFile.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Describe "Test Test-PSScriptFileInfo" -tags 'CI' {
1818
$script:testScriptsFolderPath = Join-Path $testFilesFolderPath -ChildPath "testScripts"
1919
}
2020

21-
It "determine script file with minimal required fields as valid" {
21+
It "determine script file with minimal required fields as valid" {
2222
$scriptFilePath = Join-Path -Path $tmpDir1Path -ChildPath "testscript.ps1"
2323
$scriptDescription = "this is a test script"
2424
New-PSScriptFileInfo -Path $scriptFilePath -Description $scriptDescription
@@ -64,18 +64,18 @@ Describe "Test Test-PSScriptFileInfo" -tags 'CI' {
6464
$scriptName = "ScriptWithoutEmptyLinesInMetadata.ps1"
6565
$scriptFilePath = Join-Path $script:testScriptsFolderPath -ChildPath $scriptName
6666

67-
Test-PSScriptFileInfo $scriptFilePath | Should -Be $true
67+
Test-PSScriptFileInfo $scriptFilePath | Should -Be $true
6868
}
6969

7070
It "determine script without empty lines between comment blocks is valid" {
7171
$scriptName = "ScriptWithoutEmptyLinesBetweenCommentBlocks.ps1"
7272
$scriptFilePath = Join-Path $script:testScriptsFolderPath -ChildPath $scriptName
7373

74-
Test-PSScriptFileInfo $scriptFilePath | Should -Be $true
74+
Test-PSScriptFileInfo $scriptFilePath | Should -Be $true
7575
}
7676

7777
It "determine script file with varying case sensitivity for Script Metadata or Help Comment keys is valid" {
78-
$scriptName = "VaryingCaseSensisityKeysScript.ps1"
78+
$scriptName = "VaryingCaseSensitivityKeysScript.ps1"
7979
$scriptFilePath = Join-Path $script:testScriptsFolderPath -ChildPath $scriptName
8080

8181
Test-PSScriptFileInfo $scriptFilePath | Should -Be $true

test/PublishPSResourceTests/CompressPSResource.Tests.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ Describe "Test Compress-PSResource" -tags 'CI' {
151151
It "Compress-PSResource compresses a module into a nupkg and saves it to the DestinationPath" {
152152
$version = "1.0.0"
153153
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
154-
154+
155155
Compress-PSResource -Path $script:PublishModuleBase -DestinationPath $script:repositoryPath
156-
156+
157157
$expectedPath = Join-Path -Path $script:repositoryPath -ChildPath "$script:PublishModuleName.$version.nupkg"
158158
(Get-ChildItem $script:repositoryPath).FullName | Should -Be $expectedPath
159159
}
@@ -179,7 +179,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
179179
# Must change .nupkg to .zip so that Expand-Archive can work on Windows PowerShell
180180
$nupkgPath = Join-Path -Path $script:repositoryPath -ChildPath "$script:PublishModuleName.$version.nupkg"
181181
$zipPath = Join-Path -Path $script:repositoryPath -ChildPath "$script:PublishModuleName.$version.zip"
182-
Rename-Item -Path $nupkgPath -NewName $zipPath
182+
Rename-Item -Path $nupkgPath -NewName $zipPath
183183
$unzippedPath = Join-Path -Path $TestDrive -ChildPath "$script:PublishModuleName"
184184
New-Item $unzippedPath -Itemtype directory -Force
185185
Expand-Archive -Path $zipPath -DestinationPath $unzippedPath
@@ -238,7 +238,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
238238
Remove-Item -Path $relativePath -Recurse -Force
239239
Remove-Item -Path $relativeDestination -Recurse -Force
240240
}
241-
241+
242242
It "Compress-PSResource -PassThru returns a FileInfo object with the correct path" {
243243
$version = "1.0.0"
244244
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
@@ -252,7 +252,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
252252
$fileInfoObject.Name | Should -Be "$script:PublishModuleName.$version.nupkg"
253253
}
254254

255-
It "Compress-PSResource creates nuspec dependecy version range when RequiredVersion is in RequiredModules section" {
255+
It "Compress-PSResource creates nuspec dependency version range when RequiredVersion is in RequiredModules section" {
256256
$version = "1.0.0"
257257
$requiredModules = @(
258258
@{
@@ -276,7 +276,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
276276
$nuspecxml.package.metadata.dependencies.dependency.version.replace(' ', '') | Should -BeExactly '[2.0.0]'
277277
}
278278

279-
It "Compress-PSResource creates nuspec dependecy version range when ModuleVersion is in RequiredModules section" {
279+
It "Compress-PSResource creates nuspec dependency version range when ModuleVersion is in RequiredModules section" {
280280
$version = "1.0.0"
281281
$requiredModules = @(
282282
@{
@@ -298,7 +298,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
298298
$nuspecxml.package.metadata.dependencies.dependency.version.replace(' ', '') | Should -BeExactly '2.0.0'
299299
}
300300

301-
It "Compress-PSResource creates nuspec dependecy version range when MaximumVersion is in RequiredModules section" {
301+
It "Compress-PSResource creates nuspec dependency version range when MaximumVersion is in RequiredModules section" {
302302
$version = "1.0.0"
303303
$requiredModules = @(
304304
@{
@@ -320,7 +320,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
320320
$nuspecxml.package.metadata.dependencies.dependency.version.replace(' ', '') | Should -BeExactly '(,2.0.0]'
321321
}
322322

323-
It "Compress-PSResource creates nuspec dependecy version range when ModuleVersion and MaximumVersion are in RequiredModules section" {
323+
It "Compress-PSResource creates nuspec dependency version range when ModuleVersion and MaximumVersion are in RequiredModules section" {
324324
$version = "1.0.0"
325325
$requiredModules = @(
326326
@{
@@ -343,7 +343,7 @@ Describe "Test Compress-PSResource" -tags 'CI' {
343343
$nuspecxml.package.metadata.dependencies.dependency.version.replace(' ', '') | Should -BeExactly '[1.0.0,2.0.0]'
344344
}
345345

346-
It "Compress-PSResource creates nuspec dependecy version range when there are multiple modules in RequiredModules section" {
346+
It "Compress-PSResource creates nuspec dependency version range when there are multiple modules in RequiredModules section" {
347347
$version = "1.0.0"
348348
$requiredModules = @(
349349
@{
@@ -402,14 +402,14 @@ Describe "Test Compress-PSResource" -tags 'CI' {
402402
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
403403
404404
Compress-PSResource -Path $script:PublishModuleBase -DestinationPath $script:repositoryPath2
405-
405+
406406
$expectedPath = Join-Path -Path $script:repositoryPath2 -ChildPath "$script:PublishModuleName.$version.nupkg"
407407
(Get-ChildItem $script:repositoryPath2).FullName | Should -Be $expectedPath
408408
409409
# create test cert
410410
# Create a self-signed certificate for code signing
411411
$testCert = New-SelfSignedCertificate -Subject "CN=NuGet Test Developer, OU=Use for testing purposes ONLY" -FriendlyName "NuGetTestDeveloper" -Type CodeSigning -KeyUsage DigitalSignature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256 -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -CertStoreLocation "Cert:\CurrentUser\My"
412-
412+
413413
# sign the nupkg
414414
$nupkgPath = Join-Path -Path $script:repositoryPath2 -ChildPath "$script:PublishModuleName.$version.nupkg"
415415
Set-AuthenticodeSignature -FilePath $nupkgPath -Certificate $testCert

test/PublishPSResourceTests/PublishPSResource.Tests.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
107107
}
108108
AfterEach {
109109
# Delete all contents of the repository without deleting the repository directory itself
110-
$pkgsToDelete = Join-Path -Path "$script:repositoryPath" -ChildPath "*"
110+
$pkgsToDelete = Join-Path -Path "$script:repositoryPath" -ChildPath "*"
111111
Remove-Item $pkgsToDelete -Recurse
112112

113113
$pkgsToDelete = Join-Path -Path "$script:repositoryPath2" -ChildPath "*"
@@ -318,7 +318,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
318318
# Must change .nupkg to .zip so that Expand-Archive can work on Windows PowerShell
319319
$nupkgPath = Join-Path -Path $script:repositoryPath -ChildPath "$script:PublishModuleName.$version.nupkg"
320320
$zipPath = Join-Path -Path $script:repositoryPath -ChildPath "$script:PublishModuleName.$version.zip"
321-
Rename-Item -Path $nupkgPath -NewName $zipPath
321+
Rename-Item -Path $nupkgPath -NewName $zipPath
322322
$unzippedPath = Join-Path -Path $TestDrive -ChildPath "$script:PublishModuleName"
323323
New-Item $unzippedPath -Itemtype directory -Force
324324
Expand-Archive -Path $zipPath -DestinationPath $unzippedPath
@@ -333,7 +333,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
333333
Compress-PSResource -Path $script:PublishModuleBase -DestinationPath $script:destinationPath
334334
$expectedPath = Join-Path -Path $script:destinationPath -ChildPath "$script:PublishModuleName.$version.nupkg"
335335
(Get-ChildItem $script:destinationPath).FullName | Should -Be $expectedPath
336-
336+
337337
# Pass the nupkg via -NupkgPath
338338
Publish-PSResource -NupkgPath $expectedPath -Repository $testRepository2
339339
$expectedPath = Join-Path -Path $script:repositoryPath2 -ChildPath "$script:PublishModuleName.$version.nupkg"
@@ -477,7 +477,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
477477
$moduleName = "Pester"
478478
$moduleVersion = "5.5.0"
479479
Save-PSResource -Name $moduleName -Path $tmpRepoPath -Version $moduleVersion -Repository PSGallery -TrustRepository
480-
$modulePath = Join-Path -Path $tmpRepoPath -ChildPath $moduleName
480+
$modulePath = Join-Path -Path $tmpRepoPath -ChildPath $moduleName
481481
$moduleVersionPath = Join-Path -Path $modulePath -ChildPath $moduleVersion
482482
$moduleManifestPath = Join-path -Path $moduleVersionPath -ChildPath "$moduleName.psd1"
483483
Publish-PSResource -Path $moduleManifestPath -Repository $testRepository2
@@ -569,7 +569,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
569569
$scriptPath = Join-Path -Path $script:testScriptsFolderPath -ChildPath "$scriptName.ps1"
570570
New-PSScriptFileInfo -Description 'test' -Version $scriptVersion -RequiredModules @{ModuleName='testModule'} -ExternalModuleDependencies 'testModule' -Path $scriptPath -Force
571571

572-
Publish-PSResource -Path $scriptPath
572+
Publish-PSResource -Path $scriptPath
573573

574574
$expectedPath = Join-Path -Path $script:repositoryPath -ChildPath "$scriptName.$scriptVersion.nupkg"
575575
(Get-ChildItem $script:repositoryPath).FullName | Should -Be $expectedPath
@@ -627,7 +627,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
627627
}
628628

629629
It "should write error and not publish script when Description block altogether is missing" {
630-
# we expect .ps1 files to have a separate comment block for .DESCRIPTION property, not to be included in the PSScriptInfo commment block
630+
# we expect .ps1 files to have a separate comment block for .DESCRIPTION property, not to be included in the PSScriptInfo comment block
631631
$scriptName = "InvalidScriptMissingDescriptionCommentBlock.ps1"
632632
$scriptVersion = "1.0.0"
633633

@@ -673,7 +673,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
673673
$DepPrereleaseLabel = "beta"
674674
$DepModuleRoot = Join-Path -Path $script:PublishModuleBase -ChildPath $DepModuleName
675675

676-
New-TestModule -Path $DepModuleRoot -ModuleName $DepModuleName -RepoName $testRepository2 -PackageVersion $DepVersion -prereleaseLabel $DepPrereleaseLabel
676+
New-TestModule -Path $DepModuleRoot -ModuleName $DepModuleName -RepoName $testRepository2 -PackageVersion $DepVersion -prereleaseLabel $DepPrereleaseLabel
677677
Install-PSResource -Name $DepModuleName -Repository $testRepository2 -TrustRepository -Prerelease
678678

679679
$expectedPath = Join-Path -Path $script:repositoryPath2 -ChildPath "$DepModuleName.$DepVersion-$DepPrereleaseLabel.nupkg"
@@ -714,7 +714,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
714714
New-ModuleManifest -Path $ModuleManifestPath -ModuleVersion $ModuleVersion -Description "$ModuleName module" -RequiredModules @( @{ "ModuleName" = $ReqModule1Name; "ModuleVersion" = $ReqModule1Version }, $ReqModule2Name )
715715
New-ModuleManifest -Path $ReqModule1ManifestPath -ModuleVersion $ReqModule1Version -Description "$ReqModule1Name module"
716716
New-ModuleManifest -Path $ReqModule2ManifestPath -Description "$ReqModule1Name module"
717-
717+
718718
Publish-PSResource -Path $ReqModule1ManifestPath -Repository $testRepository2
719719
Publish-PSResource -Path $ReqModule2ManifestPath -Repository $testRepository2
720720
@@ -734,7 +734,7 @@ Describe "Test Publish-PSResource with Module Prefix" -tags 'CI' {
734734

735735
BeforeAll {
736736
Get-NewPSResourceRepositoryFile
737-
737+
738738
$tmpRepoPath2 = Join-Path -Path $TestDrive -ChildPath "tmpRepoPath2"
739739
New-Item $tmpRepoPath2 -Itemtype directory -Force
740740
$testRepository2 = "testRepository2"

test/PublishPSResourceTests/PublishPSResourceContainerRegistryServer.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
469469
}
470470

471471
It "Should write error and not publish script when Description block altogether is missing" {
472-
# we expect .ps1 files to have a separate comment block for .DESCRIPTION property, not to be included in the PSScriptInfo commment block
472+
# we expect .ps1 files to have a separate comment block for .DESCRIPTION property, not to be included in the PSScriptInfo comment block
473473
$scriptName = "InvalidScriptMissingDescriptionCommentBlock.ps1"
474474

475475
$scriptFilePath = Join-Path $script:testScriptsFolderPath -ChildPath $scriptName

0 commit comments

Comments
 (0)