Skip to content

Commit 82f1d5e

Browse files
committed
fix(tests): 🐛 Update JSON test script and fix path handling
* Added a TODO comment for clarity in `JsonTest.Tests.ps1`. * Modified path handling in `PlasterManifestValidation.Tests.ps1` to ensure compatibility across platforms.
1 parent a4c9880 commit 82f1d5e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/JsonTest.Tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# TODO: What is this? GS
12
# Phase 2 Test: JSON Template Creation and Execution
23

34
Write-Host "=== Plaster 2.0 Phase 2 - JSON Template Test ===" -ForegroundColor Cyan

tests/PlasterManifestValidation.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Describe 'Module Error Handling Tests' {
221221

222222
Context 'Template cannot write outside of the user-specified DestinationPath' {
223223
It 'Throws on modify path that is absolute path' {
224-
224+
$root = if ($IsWindows) { $env:LOCALAPPDATA } else { '/' }
225225
@"
226226
<?xml version="1.0" encoding="utf-8"?>
227227
<plasterManifest schemaVersion="0.3" xmlns="http://www.microsoft.com/schemas/PowerShell/Plaster/v1">
@@ -243,7 +243,7 @@ Describe 'Module Error Handling Tests' {
243243
</modify>
244244
</content>
245245
</plasterManifest>
246-
"@ | Out-File $PlasterManifestPath -Encoding utf8
246+
"@ -f $root | Out-File $PlasterManifestPath -Encoding utf8
247247

248248
{ Invoke-Plaster -TemplatePath $TemplateDir -DestinationPath $OutDir -NoLogo 6> $null } | Should -Throw
249249
}

0 commit comments

Comments
 (0)