refactor: adapt to nuspec requirement for gallery publishing

This commit is contained in:
Rodweil, Theodor 2023-08-07 03:45:19 +02:00
parent 2019f8c959
commit 69c2684ee7
No known key found for this signature in database
GPG key ID: F8BC1B0EB1F9CCF5
29 changed files with 84 additions and 20 deletions

View file

@ -1,65 +0,0 @@
#!/usr/bin/env pwsh
$ErrorActionPreference = "Stop"
BeforeAll {
Import-Module (Join-Path $PSScriptRoot 'PSConfluencePublisher.psd1')
$mockHost = 'confluence.contoso.com'
$mockPat = '01234567890123456789'
}
Describe 'Register-PersonalAccessToken' `
{
BeforeEach {
Initialize-PersonalAccessTokenStore
}
Context 'Parameterized' {
It 'throws no exception' {
Register-PersonalAccessToken -Host $mockHost -Token $mockPat
}
}
Context 'Shorthand' {
It 'throws no exception' {
Register-PersonalAccessToken $mockHost $mockPat
}
}
}
Describe 'Get-PersonalAccessToken' `
{
BeforeEach {
Initialize-PersonalAccessTokenStore
}
Context 'Parameterized' {
It 'gets an existing PAT' {
Register-PersonalAccessToken -Host $mockHost -Token $mockPat
Get-PersonalAccessToken -Host $mockHost | Should -Be $mockPat
}
It 'requires PAT to exist' {
{Get-PersonalAccessToken -Host $mockHost} | Should -Throw
}
}
Context 'Shorthand' {
It 'throws no exception' {
Register-PersonalAccessToken -Host $mockHost -Token $mockPat
Get-PersonalAccessToken $mockHost | Should -Be $mockPat
}
}
}