-
-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tab expansion to handle params for push.
Fix #234 BTW if we decide this is an OK fix (need another set of eyes on my $gitParams regex), I'd like to review the fact that all these switch regex case statements fallthrough to the next (observed while debugging tab expansion). I don't believe that is necessary. I'm thinking that most (all) of these should have a break statement. Started a minimum set of Pester tests for tab completion. Would be good to flesh these out over time.
- Loading branch information
1 parent
5ada37f
commit 84154b9
Showing
4 changed files
with
55 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
. $PSScriptRoot\Shared.ps1 | ||
|
||
Describe 'TabExpansion Tests' { | ||
Context 'Git Push TabExpansion Tests' { | ||
It 'Tab completes remote' { | ||
$result = & $module GitTabExpansionInternal 'git push or' | ||
$result | Should BeExactly 'origin' | ||
} | ||
It 'Tab completes remote and branch' { | ||
$result = & $module GitTabExpansionInternal 'git push origin ma' | ||
$result | Should BeExactly 'master' | ||
} | ||
It 'Tab completes remote with preceding parameters' { | ||
$result = & $module GitTabExpansionInternal 'git push --follow-tags -u or' | ||
$result | Should BeExactly 'origin' | ||
} | ||
It 'Tab completes remote and branch with preceding parameters' { | ||
$result = & $module GitTabExpansionInternal 'git push --follow-tags -u origin ma' | ||
$result | Should BeExactly 'master' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
Invoke-Pester $PSScriptRoot\Utils.Tests.ps1 | ||
Invoke-Pester $PSScriptRoot |