2022-07-14 13:37:12 +02:00
|
|
|
BeforeAll {
|
|
|
|
$ManifestFile = (Get-Item -Path "./src/*.psd1").FullName
|
|
|
|
Import-Module $ManifestFile -Force
|
|
|
|
|
|
|
|
$PrivateFunctions = (Get-ChildItem -Path "./src/Private/*.ps1" | Where-Object {
|
|
|
|
$_.BaseName -notmatch '.Tests'
|
|
|
|
}
|
|
|
|
).FullName
|
|
|
|
foreach ( $func in $PrivateFunctions) {
|
|
|
|
. $func
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 12:55:29 +01:00
|
|
|
Describe "Get-TempDir" {
|
|
|
|
Context "Basic tests" {
|
|
|
|
It "Should not throw" {
|
2022-07-14 13:37:12 +02:00
|
|
|
{ Get-TempDir } | Should -Not -Throw
|
2019-01-16 12:55:29 +01:00
|
|
|
}
|
|
|
|
It "Should return the correct os tmp path" {
|
|
|
|
$Path = Get-TempDir
|
|
|
|
|
|
|
|
if ($ENV:TRAVIS) {
|
|
|
|
if ($IsLinux) {
|
|
|
|
$RefPath = (Resolve-Path -Path '/tmp/').Path
|
|
|
|
$Path | Should -Be $RefPath
|
|
|
|
}
|
|
|
|
if ($IsMacOS) {
|
|
|
|
$RefPath = (Resolve-Path -Path '/tmp/').Path
|
|
|
|
$Path | Should -Be $RefPath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($Env:APPVEYOR) {
|
2022-07-14 13:37:12 +02:00
|
|
|
if (
|
|
|
|
($isWindows) -or
|
|
|
|
($PSVersionTable.PSVersion.Major -lt 6) -or
|
|
|
|
($PSVersionTable.PSEdition -eq 'Desktop')
|
|
|
|
) {
|
2019-01-16 12:55:29 +01:00
|
|
|
$RefPath = (Resolve-Path -Path $env:TEMP).Path
|
|
|
|
$Path | Should -Be $RefPath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|