Skip to content

Commit

Permalink
šŸ©¹ [Refactor]: Rename Update-GitHubUser function to Set-GitHubUser andā€¦
Browse files Browse the repository at this point in the history
ā€¦ update references
  • Loading branch information
MariusStorhaug committed Dec 26, 2024
1 parent 8ea40cd commit 7de22c3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
filter Update-GitHubUser {
filter Set-GitHubUser {
<#
.SYNOPSIS
Update the authenticated user
Expand All @@ -9,17 +9,17 @@
displayed on your public profile or via the API.
.EXAMPLE
Update-GitHubUser -Name 'octocat'
Set-GitHubUser -Name 'octocat'
Update the authenticated user's name to 'octocat'
.EXAMPLE
Update-GitHubUser -Location 'San Francisco'
Set-GitHubUser -Location 'San Francisco'
Update the authenticated user's location to 'San Francisco'
.EXAMPLE
Update-GitHubUser -Hireable $true -Bio 'I love programming'
Set-GitHubUser -Hireable $true -Bio 'I love programming'
Update the authenticated user's hiring availability to 'true' and their biography to 'I love programming'
Expand Down
60 changes: 30 additions & 30 deletions tests/GitHub.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ Describe 'As a user - Fine-grained PAT token - user account access (USER_FG_PAT)
It 'Get-GitHubUser - Get the specified user (USER_FG_PAT)' {
{ Get-GitHubUser -Username 'Octocat' } | Should -Not -Throw
}
It 'Update-GitHubUser - Can set configuration on a user (USER_FG_PAT)' {
It 'Set-GitHubUser - Can set configuration on a user (USER_FG_PAT)' {
# $params = @{
# Name = 'Octocat'
# Blog = 'https://marius-storhaug.com'
Expand All @@ -370,27 +370,27 @@ Describe 'As a user - Fine-grained PAT token - user account access (USER_FG_PAT)
# Location = 'USA'
# Bio = 'I love programming'
# }
# { Update-GitHubUser @params } | Should -Not -Throw
# { Set-GitHubUser @params } | Should -Not -Throw
$user = Get-GitHubUser
{ Update-GitHubUser -Name 'Octocat' } | Should -Not -Throw
{ Update-GitHubUser -Blog 'https://marius-storhaug.com' } | Should -Not -Throw
{ Update-GitHubUser -TwitterUsername 'MariusStorhaug123' } | Should -Not -Throw
{ Update-GitHubUser -Company 'PSModule' } | Should -Not -Throw
{ Update-GitHubUser -Location 'USA' } | Should -Not -Throw
{ Update-GitHubUser -Bio 'I love programming' } | Should -Not -Throw
{ Set-GitHubUser -Name 'Octocat' } | Should -Not -Throw
{ Set-GitHubUser -Blog 'https://marius-storhaug.com' } | Should -Not -Throw
{ Set-GitHubUser -TwitterUsername 'MariusStorhaug123' } | Should -Not -Throw
{ Set-GitHubUser -Company 'PSModule' } | Should -Not -Throw
{ Set-GitHubUser -Location 'USA' } | Should -Not -Throw
{ Set-GitHubUser -Bio 'I love programming' } | Should -Not -Throw
$tmpUser = Get-GitHubUser
$tmpUser.name | Should -Be 'Octocat'
$tmpUser.blog | Should -Be 'https://marius-storhaug.com'
$tmpUser.twitter_username | Should -Be 'MariusStorhaug123'
$tmpUser.company | Should -Be 'PSModule'
$tmpUser.location | Should -Be 'USA'
$tmpUser.bio | Should -Be 'I love programming'
{ Update-GitHubUser -Name $user.name } | Should -Not -Throw
{ Update-GitHubUser -Blog $user.blog } | Should -Not -Throw
{ Update-GitHubUser -TwitterUsername $user.twitter_username } | Should -Not -Throw
{ Update-GitHubUser -Company $user.company } | Should -Not -Throw
{ Update-GitHubUser -Location $user.location } | Should -Not -Throw
{ Update-GitHubUser -Bio $user.bio } | Should -Not -Throw
{ Set-GitHubUser -Name $user.name } | Should -Not -Throw
{ Set-GitHubUser -Blog $user.blog } | Should -Not -Throw
{ Set-GitHubUser -TwitterUsername $user.twitter_username } | Should -Not -Throw
{ Set-GitHubUser -Company $user.company } | Should -Not -Throw
{ Set-GitHubUser -Location $user.location } | Should -Not -Throw
{ Set-GitHubUser -Bio $user.bio } | Should -Not -Throw
# $user = @{
# Name = $user.name
# Blog = $user.blog
Expand All @@ -399,7 +399,7 @@ Describe 'As a user - Fine-grained PAT token - user account access (USER_FG_PAT)
# Location = $user.location
# Bio = $user.bio
# }
# Update-GitHubUser @user
# Set-GitHubUser @user
}
}
}
Expand Down Expand Up @@ -637,7 +637,7 @@ Describe 'As a user - Classic PAT token (PAT)' {
It 'Get-GitHubUser - Get the specified user (PAT)' {
{ Get-GitHubUser -Username 'Octocat' } | Should -Not -Throw
}
It 'Update-GitHubUser - Can set configuration on a user (PAT)' {
It 'Set-GitHubUser - Can set configuration on a user (PAT)' {
# $params = @{
# Name = 'Octocat'
# Blog = 'https://marius-storhaug.com'
Expand All @@ -646,27 +646,27 @@ Describe 'As a user - Classic PAT token (PAT)' {
# Location = 'USA'
# Bio = 'I love programming'
# }
# { Update-GitHubUser @params } | Should -Not -Throw
# { Set-GitHubUser @params } | Should -Not -Throw
$user = Get-GitHubUser
{ Update-GitHubUser -Name 'Octocat' } | Should -Not -Throw
{ Update-GitHubUser -Blog 'https://marius-storhaug.com' } | Should -Not -Throw
{ Update-GitHubUser -TwitterUsername 'MariusStorhaug123' } | Should -Not -Throw
{ Update-GitHubUser -Company 'PSModule' } | Should -Not -Throw
{ Update-GitHubUser -Location 'USA' } | Should -Not -Throw
{ Update-GitHubUser -Bio 'I love programming' } | Should -Not -Throw
{ Set-GitHubUser -Name 'Octocat' } | Should -Not -Throw
{ Set-GitHubUser -Blog 'https://marius-storhaug.com' } | Should -Not -Throw
{ Set-GitHubUser -TwitterUsername 'MariusStorhaug123' } | Should -Not -Throw
{ Set-GitHubUser -Company 'PSModule' } | Should -Not -Throw
{ Set-GitHubUser -Location 'USA' } | Should -Not -Throw
{ Set-GitHubUser -Bio 'I love programming' } | Should -Not -Throw
$tmpUser = Get-GitHubUser
$tmpUser.name | Should -Be 'Octocat'
$tmpUser.blog | Should -Be 'https://marius-storhaug.com'
$tmpUser.twitter_username | Should -Be 'MariusStorhaug123'
$tmpUser.company | Should -Be 'PSModule'
$tmpUser.location | Should -Be 'USA'
$tmpUser.bio | Should -Be 'I love programming'
{ Update-GitHubUser -Name $user.name } | Should -Not -Throw
{ Update-GitHubUser -Blog $user.blog } | Should -Not -Throw
{ Update-GitHubUser -TwitterUsername $user.twitter_username } | Should -Not -Throw
{ Update-GitHubUser -Company $user.company } | Should -Not -Throw
{ Update-GitHubUser -Location $user.location } | Should -Not -Throw
{ Update-GitHubUser -Bio $user.bio } | Should -Not -Throw
{ Set-GitHubUser -Name $user.name } | Should -Not -Throw
{ Set-GitHubUser -Blog $user.blog } | Should -Not -Throw
{ Set-GitHubUser -TwitterUsername $user.twitter_username } | Should -Not -Throw
{ Set-GitHubUser -Company $user.company } | Should -Not -Throw
{ Set-GitHubUser -Location $user.location } | Should -Not -Throw
{ Set-GitHubUser -Bio $user.bio } | Should -Not -Throw
# $user = @{
# Name = $user.name
# Blog = $user.blog
Expand All @@ -675,7 +675,7 @@ Describe 'As a user - Classic PAT token (PAT)' {
# Location = $user.location
# Bio = $user.bio
# }
# Update-GitHubUser @user
# Set-GitHubUser @user
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions tools/utilities/Local-Testing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ Get-GitHubUser | Select-Object Name, login, ID, company, blog, twitter_username,
$user = Get-GitHubUser
$user.social_accounts

Update-GitHubUser -Company '@DNBBank' -Email '[email protected]' -Blog 'https://github.com/MariusStorhaug' -TwitterUsername MariusStorhaug -Location 'Norway' -Hireable $false -Bio 'DevOps Engineer at DNB Bank. I ā¤ļø PowerShell and automation.'
Update-GitHubUser -Company ' '
Update-GitHubUser -Hireable $true | Select-Object login, hireable
Update-GitHubUser -Hireable $false | Select-Object login, hireable
Set-GitHubUser -Company '@DNBBank' -Email '[email protected]' -Blog 'https://github.com/MariusStorhaug' -TwitterUsername MariusStorhaug -Location 'Norway' -Hireable $false -Bio 'DevOps Engineer at DNB Bank. I ā¤ļø PowerShell and automation.'
Set-GitHubUser -Company ' '
Set-GitHubUser -Hireable $true | Select-Object login, hireable
Set-GitHubUser -Hireable $false | Select-Object login, hireable

Add-GitHubUserSocials -AccountUrls 'https://github.com/MariusStorhaug'

Expand Down

0 comments on commit 7de22c3

Please sign in to comment.