Skip to content

Commit f459db1

Browse files
committed
Add tests
1 parent 6f54173 commit f459db1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
1212
BeforeAll{
1313
$localRepo = "psgettestlocal"
1414
$localUNCRepo = 'psgettestlocal3'
15-
$testModuleName = "test_local_mod"
15+
$testModuleName = "Test_Local_Mod"
1616
$testModuleName2 = "test_local_mod2"
1717
$similarTestModuleName = "test_local_mod.similar"
1818
$commandName = "cmd1"
@@ -48,6 +48,13 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
4848
$res.Version | Should -Be "5.0.0"
4949
}
5050

51+
It "find resource given specific Name with incorrect casing (should return correct casing)" {
52+
# FindName()
53+
$res = Find-PSResource -Name "test_local_mod" -Repository $localRepo
54+
$res.Name | Should -Be $testModuleName
55+
$res.Version | Should -Be "5.0.0"
56+
}
57+
5158
It "find resource given specific Name, Version null (module) from a UNC-based local repository" {
5259
# FindName()
5360
$res = Find-PSResource -Name $testModuleName -Repository $localUNCRepo

test/InstallPSResourceTests/InstallPSResourceLocal.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
2525
Register-LocalRepos
2626
Register-LocalTestNupkgsRepo
2727

28-
$prereleaseLabel = "alpha001"
28+
$prereleaseLabel = "Alpha001"
2929
$tags = @()
3030

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

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

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

0 commit comments

Comments
 (0)