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' {
11
11
$env: PSModulePath += [System.IO.Path ]::PathSeparator + $PSScriptRoot
12
12
$pwshConfigPath = Join-path $PSScriptRoot " class_ps_resources.dsc.yaml"
13
13
$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
+ }
14
23
}
15
24
AfterAll {
16
25
$env: PSModulePath = $OldPSModulePath
17
26
}
18
27
28
+ BeforeEach {
29
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath
30
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath_v5
31
+ }
32
+
19
33
It ' Get works on config with class-based and script-based resources' - Skip:(! $IsWindows ){
20
34
21
35
$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' {
9
9
}
10
10
$OldPSModulePath = $env: PSModulePath
11
11
$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
+ }
12
21
}
13
22
AfterAll {
14
23
$env: PSModulePath = $OldPSModulePath
15
24
}
16
25
26
+ BeforeEach {
27
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath
28
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath_v5
29
+ }
30
+
17
31
It ' Discovery includes class-based and script-based resources ' - Skip:(! $IsWindows ){
18
32
19
33
$r = dsc resource list * - a Microsoft.DSC/ PowerShell
You can’t perform that action at this time.
0 commit comments