Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/Process-PSModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -13,19 +16,21 @@ on:
- reopened
- synchronize
- labeled
- unlabeled

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write
statuses: write
contents: read
pages: write
id-token: write

jobs:
Process-PSModule:
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@11117919e65242d3388727819a751f74ad24ea9e # v5.5.0
secrets: inherit
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v8
Comment thread
MariusStorhaug marked this conversation as resolved.
Dismissed
secrets:
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
43 changes: 24 additions & 19 deletions tests/Fonts.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,66 +1,71 @@
Describe 'Fonts' {
#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.1.0'; MaximumVersion = '6.*' }

[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseDeclaredVarsMoreThanAssignments', '',
Justification = 'Required for Pester tests'
)]
[CmdletBinding()]
param()

Describe 'Fonts' {
Context 'Function: Get-Font' {
It 'The function should be available' {
Get-Command -Name 'Get-Font' | Should -Not -BeNull
Get-Command -Name 'Get-Font' | Should-NotBeNull
}

Context 'CurrentUser' {
It 'Should return a list of fonts' {
{
$fonts = Get-Font -Verbose
Write-Verbose ($fonts | Out-String) -Verbose
} | Should -Not -Throw
$fonts = Get-Font -Verbose
Write-Verbose ($fonts | Out-String) -Verbose
}
}

Context 'AllUsers' {
It 'Should return a list of fonts' {
{
$fonts = Get-Font -Scope AllUsers -Verbose
Write-Verbose ($fonts | Out-String) -Verbose
} | Should -Not -Throw
$fonts = Get-Font -Scope AllUsers -Verbose
Write-Verbose ($fonts | Out-String) -Verbose
}
}
}

Context 'Function: Install-Font' {
It 'Should be available' {
Get-Command -Name 'Install-Font' | Should -Not -BeNull
Get-Command -Name 'Install-Font' | Should-NotBeNull
}
It 'Should install a font' {
$fontPath = Join-Path -Path $PSScriptRoot -ChildPath 'Fonts/CascadiaCodePL.ttf'
{ Install-Font -Path $fontPath -Verbose } | Should -Not -Throw
Install-Font -Path $fontPath -Verbose
Write-Verbose "Installed font: 'CascadiaCodePL'" -Verbose
Write-Verbose (Get-Font | Out-String) -Verbose
}
It "Should return the installed font 'CascadiaCodePL'" {
$font = Get-Font -Name 'CascadiaCodePL'
Write-Verbose ($font | Out-String) -Verbose
$font | Should -Not -BeNullOrEmpty
$font | Should-NotBeNull
}
}

Context 'Function: Uninstall-Font' {
It 'Should be available' {
Get-Command -Name 'Uninstall-Font' | Should -Not -BeNull
Get-Command -Name 'Uninstall-Font' | Should-NotBeNull
}
It 'Should uninstall a font' {
{ Uninstall-Font -Name 'CascadiaCodePL' -Verbose } | Should -Not -Throw
Uninstall-Font -Name 'CascadiaCodePL' -Verbose
}
It 'Should NOT return the uninstalled font' {
$font = Get-Font -Name 'CascadiaCodePL'
Write-Verbose ($font | Out-String) -Verbose
$font | Should -BeNullOrEmpty
$font | Should-BeNull
}
It 'Should install and uninstall a font based on wildcard' {
$fontPath = Join-Path -Path $PSScriptRoot -ChildPath 'Fonts/CascadiaCodePL.ttf'
{ Install-Font -Path $fontPath -Verbose } | Should -Not -Throw
Install-Font -Path $fontPath -Verbose
Write-Verbose "Installed font: 'CascadiaCodePL'" -Verbose
Write-Verbose (Get-Font | Out-String) -Verbose
{ Uninstall-Font -Name 'CascadiaCode*' -Verbose } | Should -Not -Throw
Uninstall-Font -Name 'CascadiaCode*' -Verbose
$font = Get-Font -Name 'CascadiaCodePL'
Write-Verbose ($font | Out-String) -Verbose
$font | Should -BeNullOrEmpty
$font | Should-BeNull
}
}
}
Loading