File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,22 @@ 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
+ $cacheFilePath = Join-Path $env: LocalAppData " dscv3classcache.json"
16
+ if ($IsLinux -or $IsMacOS ) {
17
+ $cacheFilePath = Join-Path $env: HOME " .dsc" " dscv3classcache.json"
18
+ }
19
+ $cacheFilePath_v5 = Join-Path $env: LocalAppData " dscv3classcache-v5.json"
14
20
}
15
21
AfterAll {
16
22
$env: PSModulePath = $OldPSModulePath
17
23
}
18
24
25
+ BeforeEach {
26
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath
27
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath_v5
28
+ }
29
+
19
30
It ' Get works on config with class-based and script-based resources' - Skip:(! $IsWindows ){
20
31
21
32
$r = Get-Content - Raw $pwshConfigPath | dsc config get
Original file line number Diff line number Diff line change @@ -9,11 +9,22 @@ Describe 'PowerShell adapter resource tests' {
9
9
}
10
10
$OldPSModulePath = $env: PSModulePath
11
11
$env: PSModulePath += [System.IO.Path ]::PathSeparator + $PSScriptRoot
12
+
13
+ $cacheFilePath = Join-Path $env: LocalAppData " dscv3classcache.json"
14
+ if ($IsLinux -or $IsMacOS ) {
15
+ $cacheFilePath = Join-Path $env: HOME " .dsc" " dscv3classcache.json"
16
+ }
17
+ $cacheFilePath_v5 = Join-Path $env: LocalAppData " dscv3classcache-v5.json"
12
18
}
13
19
AfterAll {
14
20
$env: PSModulePath = $OldPSModulePath
15
21
}
16
22
23
+ BeforeEach {
24
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath
25
+ Remove-Item - Force - ea SilentlyContinue - Path $cacheFilePath_v5
26
+ }
27
+
17
28
It ' Discovery includes class-based and script-based resources ' - Skip:(! $IsWindows ){
18
29
19
30
$r = dsc resource list * - a Microsoft.DSC/ PowerShell
You can’t perform that action at this time.
0 commit comments