Skip to content

Commit 8a9d42e

Browse files
committed
Test subfolders in .git and .github, too
1 parent d8d50d1 commit 8a9d42e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/Get-GitStatus.Tests.ps1

+15-1
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,21 @@ U test/Unmerged.Tests.ps1
464464
$status.HasUntracked | Should -Be $false
465465
$status.HasWorking | Should -Be $false
466466
$status.Working.Added.Count | Should -Be 0
467+
468+
Set-Location "$repoPath/.git/refs" -ErrorAction Stop
469+
470+
$status = Get-GitStatus
471+
$status.HasUntracked | Should -Be $false
472+
$status.HasWorking | Should -Be $false
473+
$status.Working.Added.Count | Should -Be 0
467474
}
468475
}
469476

470477
Context 'In .github' {
471478
BeforeEach {
472479
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
473480
$repoPath = NewGitTempRepo
474-
mkdir "$repoPath/.github"
481+
mkdir "$repoPath/.github/workflows"
475482
}
476483
AfterEach {
477484
Set-Location $PSScriptRoot
@@ -492,6 +499,13 @@ U test/Unmerged.Tests.ps1
492499
$status.HasUntracked | Should -Be $true
493500
$status.HasWorking | Should -Be $true
494501
$status.Working.Added.Count | Should -Be 1
502+
503+
Set-Location "$repoPath/.github/workflows" -ErrorAction Stop
504+
505+
$status = Get-GitStatus
506+
$status.HasUntracked | Should -Be $true
507+
$status.HasWorking | Should -Be $true
508+
$status.Working.Added.Count | Should -Be 1
495509
}
496510
}
497511
}

0 commit comments

Comments
 (0)