From 2767d0e512d841fd6a8af80c524c1ba68e64f52d Mon Sep 17 00:00:00 2001 From: Noah Sherwin Date: Tue, 28 Jan 2025 20:34:50 -0800 Subject: [PATCH] test(scoop-status): replace "Import-Module" calls with dot-sourced execution; remove unused variables and dead code --- test/Scoop-Status.Tests.ps1 | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/test/Scoop-Status.Tests.ps1 b/test/Scoop-Status.Tests.ps1 index 1f713dc648..605f73959a 100644 --- a/test/Scoop-Status.Tests.ps1 +++ b/test/Scoop-Status.Tests.ps1 @@ -3,19 +3,6 @@ BeforeAll { . "$PSScriptRoot\..\lib\manifest.ps1" # 'manifest' 'parse_json' "install_info" . "$PSScriptRoot\..\lib\versions.ps1" # 'Select-CurrentVersion' . "$PSScriptRoot\..\lib\core.ps1" # 'versiondir' - Import-Module "$PSScriptRoot\..\lib\core.ps1" -Function 'versiondir' - - # check if scoop needs updating - $currentdir = versiondir 'scoop' 'current' - $needs_update = $false - $bucket_needs_update = $false - $script:network_failure = $false - $no_remotes = $args[0] -eq '-l' -or $args[0] -eq '--local' - if (!(Get-Command git -ErrorAction SilentlyContinue)) { $no_remotes = $true } - $list = @() - if (!(Get-FormatData ScoopStatus)) { - Update-FormatData "$PSScriptRoot\..\supporting\formats\ScoopTypes.Format.ps1xml" - } } # script-level content @@ -30,7 +17,7 @@ Describe -Skip 'Show status and check for new app versions' -Tag 'Scoop' { Describe 'Test-UpdateStatus' -Tag 'Scoop' { BeforeAll { - Import-Module "$PSScriptRoot/../libexec/scoop-status.ps1" -Function 'Test-UpdateStatus' + . "$PSScriptRoot/../libexec/scoop-status.ps1" } # todo It -Skip 'should return $true if $commits is falsy' {