Skip to content

Commit

Permalink
🩹 [Patch]: Fix Git configuration URL syntax and refactor test structure
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Nov 30, 2024
1 parent dc67e8e commit 08e1c48
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/functions/public/Git/Set-GitHubGitConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if ($PSCmdlet.ShouldProcess("$Name", 'Set Git configuration')) {
git config --global user.name "$username"
git config --global user.email "$id+$username@users.noreply.github.com"
git config --global url."https://oauth2:$token@$hostName".insteadOf https://$hostName
git config --global "url.https://oauth2:$token@$hostName.insteadOf" "https://$hostName"
Write-Verbose "[$commandName] - End"
}
}
52 changes: 25 additions & 27 deletions tests/GitHub.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,34 @@ Describe 'GitHub' {
$gitConfig.'user.email' | Should -Not -BeNullOrEmpty
}
}
}

Context 'API' {
It 'Can be called directly to get ratelimits' {
{
$rateLimit = Invoke-GitHubAPI -ApiEndpoint '/rate_limit'
Write-Verbose ($rateLimit | Format-Table | Out-String) -Verbose
} | Should -Not -Throw

}
}
Context 'API' {
It 'Can be called directly to get ratelimits' {
{
$rateLimit = Invoke-GitHubAPI -ApiEndpoint '/rate_limit'
Write-Verbose ($rateLimit | Format-Table | Out-String) -Verbose
} | Should -Not -Throw

Describe 'Commands' {
It "Start-LogGroup 'MyGroup' should not throw" {
{
Start-LogGroup 'MyGroup'
} | Should -Not -Throw
}
}
Describe 'Commands' {
It "Start-LogGroup 'MyGroup' should not throw" {
{
Start-LogGroup 'MyGroup'
} | Should -Not -Throw
}

It 'Stop-LogGroup should not throw' {
{
Stop-LogGroup
} | Should -Not -Throw
}
It 'Stop-LogGroup should not throw' {
{
Stop-LogGroup
} | Should -Not -Throw
}

It "LogGroup 'MyGroup' should not throw" {
{
LogGroup 'MyGroup' {
Get-ChildItem env: | Select-Object Name, Value | Format-Table -AutoSize
}
} | Should -Not -Throw
It "LogGroup 'MyGroup' should not throw" {
{
LogGroup 'MyGroup' {
Get-ChildItem env: | Select-Object Name, Value | Format-Table -AutoSize
}
} | Should -Not -Throw
}
}
}

0 comments on commit 08e1c48

Please sign in to comment.