-
-
Notifications
You must be signed in to change notification settings - Fork 81
Reviewer checklist + Pester v5 unit tests for dependency scripts #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
33535bd
docs: add PSDependScripts reviewer checklist
HeyItsGilbert e5693a2
test: add Pester v5 unit tests for each dependency script
HeyItsGilbert 48f9280
test: fix CI failures in Git and FileSystem dependency tests
HeyItsGilbert 9f3260f
test: fix FileSystem path resolution on Linux/macOS
HeyItsGilbert 562df0a
fix(PSGalleryModule): 🐛 improve dependency handling and parameter val…
HeyItsGilbert 883a7c1
test: skip Windows-only type tests on unsupported platforms and mock …
HeyItsGilbert 9a2bfc3
chore(ci): ✨ update CI workflow for improved clarity and structure
HeyItsGilbert 9eb1188
test: drop duplicate PSGalleryModule Test-action test
HeyItsGilbert 37b1f86
fix(PSGalleryModule): 🐛 improve NuGet provider detection logic
HeyItsGilbert a2f31c9
fix: 🐛 standardize usage of `[PSCustomObject]` across scripts
HeyItsGilbert 54ccc14
fix(SemanticVersion): 🐛 improve version check logic for type definition
HeyItsGilbert 58e9054
fix(Command): 🐛 handle errors more gracefully in command execution
HeyItsGilbert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #requires -Module @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0' } | ||
|
|
||
| BeforeAll { | ||
| if (-not $env:BHProjectPath) { | ||
| Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force | ||
| } | ||
| Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue | ||
| Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force | ||
|
|
||
| Import-Module (Join-Path $PSScriptRoot 'Shared/TestHelpers.psm1') -Force | ||
|
|
||
| $script:ScriptPath = Join-Path $env:BHProjectPath 'PSDepend/PSDependScripts/Chocolatey.ps1' | ||
| } | ||
|
|
||
| Describe 'Chocolatey script' -Tag 'WindowsOnly' { | ||
|
|
||
| BeforeAll { | ||
| InModuleScope PSDepend { | ||
| # Pretend choco.exe is present so we skip the bootstrap branch | ||
| Mock Get-Command { [pscustomobject]@{ Name = 'choco.exe' } } -ParameterFilter { $Name -eq 'choco.exe' } | ||
| # All choco invocations return empty CSV (no packages installed, none found upstream) | ||
| Mock Invoke-ExternalCommand { } | ||
| Mock Invoke-WebRequest { } | ||
| } | ||
| } | ||
|
|
||
| It 'Defaults Source to https://chocolatey.org/api/v2/ when not supplied' { | ||
| $dep = New-PSDependFixture -DependencyName 'git' -DependencyType 'Chocolatey' | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -WarningAction SilentlyContinue | ||
| } | ||
| # We can't verify the default by inspecting choco args (script bails out | ||
| # when latest lookup returns nothing) but the script should not throw. | ||
| $true | Should -BeTrue | ||
| } | ||
|
|
||
| It 'Invokes choco upgrade with -Force when -Force switch is set' { | ||
| $dep = New-PSDependFixture -DependencyName 'git' -DependencyType 'Chocolatey' -Version '2.0.2' | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -Force | ||
| } | ||
| Should -Invoke -CommandName Invoke-ExternalCommand -ModuleName PSDepend -Times 1 -Exactly -ParameterFilter { | ||
| $Arguments -contains 'upgrade' -and $Arguments -contains '--force' | ||
| } | ||
| } | ||
|
|
||
| It 'Forwards Credential to choco as --username / --password args' { | ||
| $cred = New-TestCredential -UserName 'feeduser' -Password 'feedpass' | ||
| $dep = New-PSDependFixture -DependencyName 'git' -DependencyType 'Chocolatey' -Version '2.0.2' -Credential $cred | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -Force | ||
| } | ||
| Should -Invoke -CommandName Invoke-ExternalCommand -ModuleName PSDepend -Times 1 -Exactly -ParameterFilter { | ||
| ($Arguments -join ' ') -match "--username='feeduser'" -and ($Arguments -join ' ') -match "--password='feedpass'" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #requires -Module @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0' } | ||
|
|
||
| BeforeAll { | ||
| if (-not $env:BHProjectPath) { | ||
| Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force | ||
| } | ||
| Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue | ||
| Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force | ||
|
|
||
| Import-Module (Join-Path $PSScriptRoot 'Shared/TestHelpers.psm1') -Force | ||
|
|
||
| $script:ScriptPath = Join-Path $env:BHProjectPath 'PSDepend/PSDependScripts/Command.ps1' | ||
| } | ||
|
|
||
| Describe 'Command script' { | ||
|
|
||
| It 'Executes the Source string as PowerShell in the current session' { | ||
| $flagPath = Join-Path 'TestDrive:' 'flag.txt' | ||
| $dep = New-PSDependFixture -DependencyName 'CmdOne' -DependencyType 'Command' -Source "Set-Content -Path '$flagPath' -Value 'ran'" | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| (Get-Content $flagPath) | Should -Be 'ran' | ||
| } | ||
|
|
||
| It 'Iterates multiple Source entries' { | ||
| $countPath = Join-Path 'TestDrive:' 'count.txt' | ||
| $dep = New-PSDependFixture -DependencyName 'CmdMulti' -DependencyType 'Command' -Source @( | ||
| "Add-Content '$countPath' 'a'" | ||
| "Add-Content '$countPath' 'b'" | ||
| ) | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| (Get-Content $countPath) | Should -Be @('a', 'b') | ||
| } | ||
|
|
||
| It 'Throws by default when the Source errors' { | ||
| $dep = New-PSDependFixture -DependencyName 'CmdFail' -DependencyType 'Command' -Source "throw 'boom'" | ||
| { | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| } | Should -Throw -ExpectedMessage '*boom*' | ||
| } | ||
|
|
||
| It 'Continues past errors when -FailOnError is specified' { | ||
| $dep = New-PSDependFixture -DependencyName 'CmdSwallow' -DependencyType 'Command' -Source "throw 'boom'" | ||
| $err = $null | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -FailOnError -ErrorAction SilentlyContinue -ErrorVariable err | ||
| $script:capturedErr = $err | ||
| } | ||
| # Did not throw — Write-Error was used | ||
| $true | Should -BeTrue | ||
|
HeyItsGilbert marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #requires -Module @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0' } | ||
|
|
||
| BeforeAll { | ||
| if (-not $env:BHProjectPath) { | ||
| Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force | ||
| } | ||
| Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue | ||
| Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force | ||
|
|
||
| Import-Module (Join-Path $PSScriptRoot 'Shared/TestHelpers.psm1') -Force | ||
|
|
||
| $script:ScriptPath = Join-Path $env:BHProjectPath 'PSDepend/PSDependScripts/DotnetSdk.ps1' | ||
| $script:OrigPath = $env:PATH | ||
| } | ||
|
|
||
| AfterAll { | ||
| if ($script:OrigPath) { $env:PATH = $script:OrigPath } | ||
| } | ||
|
|
||
| Describe 'DotnetSdk script' { | ||
|
|
||
| BeforeAll { | ||
| InModuleScope PSDepend { | ||
| Mock Install-Dotnet { } | ||
| Mock Test-Dotnet { $false } | ||
| } | ||
| } | ||
|
|
||
| It 'PSDependAction Test delegates to Test-Dotnet' { | ||
| InModuleScope PSDepend { Mock Test-Dotnet { $true } } | ||
| $dep = New-PSDependFixture -DependencyName 'release' -DependencyType 'DotnetSdk' -Version '2.1.0' | ||
| $result = InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -PSDependAction Test | ||
| } | ||
| $result | Should -Be $true | ||
| Should -Invoke -CommandName Test-Dotnet -ModuleName PSDepend -Times 1 | ||
| } | ||
|
|
||
| It 'Calls Install-Dotnet when Test-Dotnet reports SDK is missing' { | ||
| $installDir = (New-Item 'TestDrive:/dotnet' -ItemType Directory -Force).FullName | ||
| $dep = New-PSDependFixture -DependencyName 'release' -DependencyType 'DotnetSdk' -Version '2.1.0' -Target $installDir | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath; D = $installDir } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Install-Dotnet -ModuleName PSDepend -Times 1 -Exactly -ParameterFilter { | ||
| $Channel -eq 'release' -and $Version -eq '2.1.0' -and $InstallDir -eq $installDir | ||
| } | ||
| } | ||
|
|
||
| It 'Skips Install-Dotnet when Test-Dotnet reports SDK is present' { | ||
| InModuleScope PSDepend { Mock Test-Dotnet { $true } } | ||
| $dep = New-PSDependFixture -DependencyName 'LTS' -DependencyType 'DotnetSdk' -Version '2.1.0' | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Install-Dotnet -ModuleName PSDepend -Times 0 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| #requires -Module @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0' } | ||
|
|
||
| BeforeAll { | ||
| if (-not $env:BHProjectPath) { | ||
| Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force | ||
| } | ||
| Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue | ||
| Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force | ||
|
|
||
| Import-Module (Join-Path $PSScriptRoot 'Shared/TestHelpers.psm1') -Force | ||
|
|
||
| $script:ScriptPath = Join-Path $env:BHProjectPath 'PSDepend/PSDependScripts/FileDownload.ps1' | ||
| } | ||
|
|
||
| Describe 'FileDownload script' { | ||
|
|
||
| BeforeAll { | ||
| InModuleScope PSDepend { | ||
| Mock Get-WebFile { } | ||
| Mock Add-ToItemCollection { } | ||
| } | ||
| } | ||
|
|
||
| It 'Downloads to Target with filename parsed from the URL when Target is an existing folder' { | ||
| $targetDir = (New-Item 'TestDrive:/dl' -ItemType Directory -Force).FullName | ||
| $dep = New-PSDependFixture -DependencyName 'https://example.com/sample.dll' -DependencyType 'FileDownload' -Target $targetDir | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath; T = $targetDir } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Get-WebFile -ModuleName PSDepend -Times 1 -Exactly -ParameterFilter { | ||
| $URL -eq 'https://example.com/sample.dll' -and ($Path -like "*sample.dll") | ||
| } | ||
| } | ||
|
|
||
| It 'Uses Source to override the URL when supplied' { | ||
| $targetDir = (New-Item 'TestDrive:/dl2' -ItemType Directory -Force).FullName | ||
| $dep = New-PSDependFixture -DependencyName 'ignored-key' -DependencyType 'FileDownload' -Target $targetDir -Source 'https://example.com/other.dll' | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Get-WebFile -ModuleName PSDepend -Times 1 -Exactly -ParameterFilter { | ||
| $URL -eq 'https://example.com/other.dll' | ||
| } | ||
| } | ||
|
|
||
| It 'Skips download when the target file already exists' { | ||
| $targetDir = (New-Item 'TestDrive:/dl3' -ItemType Directory -Force).FullName | ||
| $existingFile = Join-Path $targetDir 'sample.dll' | ||
| Set-Content -Path $existingFile -Value 'existing' | ||
|
|
||
| $dep = New-PSDependFixture -DependencyName 'https://example.com/sample.dll' -DependencyType 'FileDownload' -Target $existingFile | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Get-WebFile -ModuleName PSDepend -Times 0 | ||
| } | ||
|
|
||
| It 'PSDependAction Test returns $true when the file exists' { | ||
| $targetDir = (New-Item 'TestDrive:/dl4' -ItemType Directory -Force).FullName | ||
| $existingFile = Join-Path $targetDir 'sample.dll' | ||
| Set-Content -Path $existingFile -Value 'existing' | ||
|
|
||
| $dep = New-PSDependFixture -DependencyName 'https://example.com/sample.dll' -DependencyType 'FileDownload' -Target $existingFile | ||
| $result = InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -PSDependAction Test | ||
| } | ||
| $result | Should -Be $true | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #requires -Module @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0' } | ||
|
|
||
| BeforeAll { | ||
| if (-not $env:BHProjectPath) { | ||
| Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force | ||
| } | ||
| Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue | ||
| Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force | ||
|
|
||
| Import-Module (Join-Path $PSScriptRoot 'Shared/TestHelpers.psm1') -Force | ||
|
|
||
| $script:ScriptPath = Join-Path $env:BHProjectPath 'PSDepend/PSDependScripts/FileSystem.ps1' | ||
| } | ||
|
|
||
| Describe 'FileSystem script' { | ||
|
|
||
| BeforeAll { | ||
| InModuleScope PSDepend { | ||
| Mock Copy-Item { } | ||
| } | ||
| } | ||
|
|
||
| It 'Copies a file from Source to Target when hashes differ' { | ||
| $src = Join-Path 'TestDrive:' 'src.txt' | ||
| $tgtDir = (New-Item 'TestDrive:/tgt' -ItemType Directory -Force).FullName | ||
| Set-Content -Path $src -Value 'hello' | ||
| $srcResolved = (Resolve-Path $src).ProviderPath | ||
|
|
||
| $dep = New-PSDependFixture -DependencyName 'fs-file' -DependencyType 'FileSystem' -Source $srcResolved -Target $tgtDir | ||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Copy-Item -ModuleName PSDepend -Times 1 | ||
| } | ||
|
|
||
| It 'PSDependAction Test returns $false when target is missing' { | ||
| $src = Join-Path 'TestDrive:' 'src2.txt' | ||
| $tgtDir = (New-Item 'TestDrive:/missing-tgt' -ItemType Directory -Force).FullName | ||
| Set-Content -Path $src -Value 'content' | ||
| $srcResolved = (Resolve-Path $src).ProviderPath | ||
|
|
||
| $dep = New-PSDependFixture -DependencyName 'fs-test' -DependencyType 'FileSystem' -Source $srcResolved -Target $tgtDir | ||
| $result = InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -PSDependAction Test | ||
| } | ||
| $result | Should -Be $false | ||
| } | ||
|
HeyItsGilbert marked this conversation as resolved.
Outdated
|
||
|
|
||
| It 'Errors and skips when Source does not exist' { | ||
| $tgtDir = (New-Item 'TestDrive:/tgt3' -ItemType Directory -Force).FullName | ||
| $missingSrc = (Join-Path (Resolve-Path 'TestDrive:').ProviderPath 'does-not-exist.txt') | ||
| $dep = New-PSDependFixture -DependencyName 'fs-missing' -DependencyType 'FileSystem' -Source $missingSrc -Target $tgtDir | ||
|
|
||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -ErrorAction SilentlyContinue | ||
| } | ||
| Should -Invoke -CommandName Copy-Item -ModuleName PSDepend -Times 0 | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #requires -Module @{ ModuleName = 'Pester'; ModuleVersion = '5.0.0' } | ||
|
|
||
| BeforeAll { | ||
| if (-not $env:BHProjectPath) { | ||
| Set-BuildEnvironment -Path "$PSScriptRoot/.." -Force | ||
| } | ||
| Remove-Module $env:BHProjectName -ErrorAction SilentlyContinue | ||
| Import-Module (Join-Path $env:BHProjectPath $env:BHProjectName) -Force | ||
|
|
||
| Import-Module (Join-Path $PSScriptRoot 'Shared/TestHelpers.psm1') -Force | ||
|
|
||
| $script:ScriptPath = Join-Path $env:BHProjectPath 'PSDepend/PSDependScripts/Git.ps1' | ||
| } | ||
|
|
||
| Describe 'Git script' { | ||
|
|
||
| BeforeAll { | ||
| InModuleScope PSDepend { | ||
| Mock Invoke-ExternalCommand { } | ||
| Mock Import-PSDependModule { } | ||
| Mock Add-ToItemCollection { } | ||
| } | ||
| } | ||
|
|
||
| It 'Clones the repo via git when the target does not exist' { | ||
| $targetDir = (New-Item 'TestDrive:/git-target' -ItemType Directory -Force).FullName | ||
| $dep = New-PSDependFixture -DependencyName 'https://example.com/user/repo.git' -DependencyType 'Git' -Target $targetDir | ||
|
|
||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
|
HeyItsGilbert marked this conversation as resolved.
Outdated
|
||
| # git clone + git checkout | ||
| Should -Invoke -CommandName Invoke-ExternalCommand -ModuleName PSDepend -Times 1 -ParameterFilter { | ||
| $Arguments -contains 'clone' | ||
| } | ||
| Should -Invoke -CommandName Invoke-ExternalCommand -ModuleName PSDepend -Times 1 -ParameterFilter { | ||
| $Arguments -contains 'checkout' | ||
| } | ||
| } | ||
|
|
||
| It 'Converts account/repo shorthand to a GitHub URL' { | ||
| $targetDir = (New-Item 'TestDrive:/git-target2' -ItemType Directory -Force).FullName | ||
| $dep = New-PSDependFixture -DependencyName 'user/repo' -DependencyType 'Git' -Target $targetDir | ||
|
|
||
| InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep | ||
| } | ||
| Should -Invoke -CommandName Invoke-ExternalCommand -ModuleName PSDepend -Times 1 -ParameterFilter { | ||
| $Arguments -contains 'clone' -and ($Arguments -contains 'https://github.com/user/repo.git') | ||
| } | ||
| } | ||
|
|
||
| It 'PSDependAction Test returns $false when the repo path does not exist' { | ||
| $targetDir = (New-Item 'TestDrive:/git-test' -ItemType Directory -Force).FullName | ||
| $dep = New-PSDependFixture -DependencyName 'https://example.com/user/repo.git' -DependencyType 'Git' -Target $targetDir | ||
|
|
||
| $result = InModuleScope PSDepend -Parameters @{ Dep = $dep; ScriptPath = $script:ScriptPath } { | ||
| & $ScriptPath -Dependency $Dep -PSDependAction Test | ||
| } | ||
| $result | Should -Be $false | ||
| Should -Invoke -CommandName Invoke-ExternalCommand -ModuleName PSDepend -Times 0 | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.