Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Sep 27, 2023
1 parent 8a05ecf commit d4860ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Generate-GitBranches.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Describe "Generate-GitBranches.ps1" {
cd $sameRepo
git config user.name "bot"
git config user.email "[email protected]"
$branches = git branch | % { $_.Trim() } | ? { $_ -match '^steam-' }
$branches = git branch | % { $_.Replace('*', '').Trim() } | ? { $_ -match '^steam-' }
foreach ($b in $branches) {
git branch -D $b
}
Expand All @@ -43,7 +43,7 @@ Describe "Generate-GitBranches.ps1" {
& ./Generate-GitBranches.ps1 -TargetRepo . -Pull -ErrorAction Stop -WhatIf 6>$null # Update

cd $sameRepo
$branches = git branch | % { $_.Trim() } | ? { $_ -match '^steam-' }
$branches = git branch | % { $_.Replace('*', '').Trim() } | ? { $_ -match '^steam-' }
$branches.Count | Should -Be 0
}

Expand All @@ -55,7 +55,7 @@ Describe "Generate-GitBranches.ps1" {
& ./Generate-GitBranches.ps1 -TargetRepo . -Pull -ErrorAction Stop 6>$null # Update

cd $sameRepo
$branches = git branch | % { $_.Trim() } | ? { $_ -match '^steam-' }
$branches = git branch | % { $_.Replace('*', '').Trim() } | ? { $_ -match '^steam-' }
$branches.Count | Should -Be $games.Count
foreach ($b in $branches) {
git ls-tree -r --name-only $b | Should -Be @(
Expand All @@ -82,7 +82,7 @@ Describe "Generate-GitBranches.ps1" {
git config user.name "bot"
git config user.email "[email protected]"
git commit --allow-empty -m 'Init'
$branches = git branch | % { $_.Trim() } | ? { $_ -match '^steam-' }
$branches = git branch | % { $_.Replace('*', '').Trim() } | ? { $_ -match '^steam-' }
foreach ($b in $branches) {
git branch -D $b
}
Expand All @@ -93,7 +93,7 @@ Describe "Generate-GitBranches.ps1" {
& $sourceRepo/Generate-GitBranches.ps1 -TargetRepo $differentRepo -ErrorAction Stop 6>$null -WhatIf # Update

cd $differentRepo
$branches = git branch | % { $_.Trim() } | ? { $_ -match '^steam-' }
$branches = git branch | % { $_.Replace('*', '').Trim() } | ? { $_ -match '^steam-' }
$branches.Count | Should -Be 0
}

Expand All @@ -102,7 +102,7 @@ Describe "Generate-GitBranches.ps1" {
& $sourceRepo/Generate-GitBranches.ps1 -TargetRepo $differentRepo -ErrorAction Stop 6>$null # Update

cd $differentRepo
$branches = git branch | % { $_.Trim() } | ? { $_ -match '^steam-' }
$branches = git branch | % { $_.Replace('*', '').Trim() } | ? { $_ -match '^steam-' }
$branches.Count | Should -Be $games.Count
foreach ($b in $branches) {
git ls-tree -r --name-only $b | Should -Be @(
Expand Down

0 comments on commit d4860ee

Please sign in to comment.