File tree Expand file tree Collapse file tree 3 files changed +227
-104
lines changed
Expand file tree Collapse file tree 3 files changed +227
-104
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,25 @@ Describe 'PowerShell adapter resource tests' {
1111 $env: PSModulePath += [System.IO.Path ]::PathSeparator + $PSScriptRoot
1212 $pwshConfigPath = Join-path $PSScriptRoot " class_ps_resources.dsc.yaml"
1313 $winpsConfigPath = Join-path $PSScriptRoot " winps_resource.dsc.yaml"
14+
15+ if ($IsLinux -or $IsMacOS ) {
16+ $cacheFilePath = Join-Path $env: HOME " .dsc" " PSAdapterCache.json"
17+ }
18+ else
19+ {
20+ $cacheFilePath = Join-Path $env: LocalAppData " dsc" " PSAdapterCache.json"
21+ $cacheFilePath_v5 = Join-Path $env: LocalAppData " dsc" " WindowsPSAdapterCache.json"
22+ }
1423 }
1524 AfterAll {
1625 $env: PSModulePath = $OldPSModulePath
1726 }
1827
28+ BeforeEach {
29+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath
30+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath_v5
31+ }
32+
1933 It ' Get works on config with class-based and script-based resources' - Skip:(! $IsWindows ){
2034
2135 $r = Get-Content - Raw $pwshConfigPath | dsc config get
Original file line number Diff line number Diff line change @@ -9,11 +9,25 @@ Describe 'PowerShell adapter resource tests' {
99 }
1010 $OldPSModulePath = $env: PSModulePath
1111 $env: PSModulePath += [System.IO.Path ]::PathSeparator + $PSScriptRoot
12+
13+ if ($IsLinux -or $IsMacOS ) {
14+ $cacheFilePath = Join-Path $env: HOME " .dsc" " PSAdapterCache.json"
15+ }
16+ else
17+ {
18+ $cacheFilePath = Join-Path $env: LocalAppData " dsc" " PSAdapterCache.json"
19+ $cacheFilePath_v5 = Join-Path $env: LocalAppData " dsc" " WindowsPSAdapterCache.json"
20+ }
1221 }
1322 AfterAll {
1423 $env: PSModulePath = $OldPSModulePath
1524 }
1625
26+ BeforeEach {
27+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath
28+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath_v5
29+ }
30+
1731 It ' Discovery includes class-based and script-based resources ' - Skip:(! $IsWindows ){
1832
1933 $r = dsc resource list * - a Microsoft.DSC/ PowerShell
You can’t perform that action at this time.
0 commit comments