Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alerickson committed Oct 28, 2024
1 parent 6f54173 commit f459db1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
BeforeAll{
$localRepo = "psgettestlocal"
$localUNCRepo = 'psgettestlocal3'
$testModuleName = "test_local_mod"
$testModuleName = "Test_Local_Mod"
$testModuleName2 = "test_local_mod2"
$similarTestModuleName = "test_local_mod.similar"
$commandName = "cmd1"
Expand Down Expand Up @@ -48,6 +48,13 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
$res.Version | Should -Be "5.0.0"
}

It "find resource given specific Name with incorrect casing (should return correct casing)" {
# FindName()
$res = Find-PSResource -Name "test_local_mod" -Repository $localRepo
$res.Name | Should -Be $testModuleName
$res.Version | Should -Be "5.0.0"
}

It "find resource given specific Name, Version null (module) from a UNC-based local repository" {
# FindName()
$res = Find-PSResource -Name $testModuleName -Repository $localUNCRepo
Expand Down
6 changes: 3 additions & 3 deletions test/InstallPSResourceTests/InstallPSResourceLocal.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
Register-LocalRepos
Register-LocalTestNupkgsRepo

$prereleaseLabel = "alpha001"
$prereleaseLabel = "Alpha001"
$tags = @()

New-TestModule -moduleName $testModuleName -repoName $localRepo -packageVersion "1.0.0" -prereleaseLabel "" -tags $tags
Expand Down Expand Up @@ -131,12 +131,12 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
$pkg.Version | Should -Be "3.0.0"
}

It "Install resource with latest (including prerelease) version given Prerelease parameter" {
It "Install resource with latest (including prerelease) version given Prerelease parameter (prerelease casing should be correct)" {
Install-PSResource -Name $testModuleName -Prerelease -Repository $localRepo -TrustRepository
$pkg = Get-InstalledPSResource $testModuleName
$pkg.Name | Should -Be $testModuleName
$pkg.Version | Should -Be "5.2.5"
$pkg.Prerelease | Should -Be "alpha001"
$pkg.Prerelease | Should -Be "Alpha001"
}

It "Install resource with cmdlet names from a module already installed with -NoClobber (should not clobber)" {
Expand Down

0 comments on commit f459db1

Please sign in to comment.