fix(manifest): allow for non cwd backups

- fix a fault where the backup file was only generated within the current
  directory

- fix a fault in Pester tests, where the parameter was wrongly used as the
  script block for assertion.
This commit is contained in:
Rodweil, Theodor 2023-07-30 20:20:49 +02:00
parent 8533997b68
commit 3c7ba0e2a4
No known key found for this signature in database
GPG key ID: F8BC1B0EB1F9CCF5
2 changed files with 23 additions and 9 deletions

View file

@ -108,12 +108,12 @@ Describe 'Set-Manifest' `
Mock Copy-Item {
#FIXME: the scope is completely wrong
Should -Invoke -CommandName 'Copy-Item' -Exactly -Times 1
Should -Invoke -CommandName 'Copy-Item' -Exactly -Times 1 `
$args[1] | Should -Be 'foobar.x'
$Path | Should -Be 'foobar.x'
$args[3] | Should -Be 'foobar.x.bck'
}
$Destination | Should -Be 'foobar.x.bck'
}
#mocking Get-Content, therefore file name can be bogus
Set-Manifest `
@ -139,11 +139,11 @@ Describe 'Set-Manifest' `
Mock Copy-Item {
#FIXME: the scope is completely wrong
Should -Invoke -CommandName 'Copy-Item' -Exactly -Times 1
Should -Invoke -CommandName 'Copy-Item' -Exactly -Times 1 `
$args[1] | Should -Be 'foo/bar/foobar.x'
$Path | Should -Be 'foo/bar/foobar.x'
$args[3] | Should -Be 'foo/bar/foobar.x.bck'
$Destination | Should -Be 'foo/bar/foobar.x.bck'
}
#mocking Get-Content, therefore file name can be bogus