Skip to content

Commit

Permalink
Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppecampanelli committed Jun 3, 2020
1 parent 33dd7b9 commit 65c4a06
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Tests/GitHubRepositories.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ try
BeforeAll -ScriptBlock {
$repoName = ([Guid]::NewGuid().Guid)
$repo = New-GitHubRepository -RepositoryName $repoName -Description $defaultRepoDesc -AutoInit

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$repoName = $repoName
$repo = $repo
}

It 'Should get repository' {
Expand All @@ -152,10 +156,13 @@ try
Context -Name 'For deleting a repository' -Fixture {
BeforeAll -ScriptBlock {
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -Description $defaultRepoDesc -AutoInit

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$repo = $repo
}

It 'Should get no content' {
$delete = Remove-GitHubRepository -OwnerName $repo.owner.login -RepositoryName $repo.name -Confirm:$false
Remove-GitHubRepository -OwnerName $repo.owner.login -RepositoryName $repo.name -Confirm:$false
{ Get-GitHubRepository -OwnerName $repo.owner.login -RepositoryName $repo.name } | Should -Throw
}
}
Expand All @@ -168,6 +175,9 @@ try
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -AutoInit
$suffixToAddToRepo = "_renamed"
$newRepoName = "$($repo.name)$suffixToAddToRepo"

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$newRepoName = $newRepoName
}

It "Should have the expected new repository name - by URI" {
Expand All @@ -191,6 +201,9 @@ try
Context -Name 'For creating a repository' -Fixture {
BeforeAll -ScriptBlock {
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -Description $defaultRepoDesc -AutoInit

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$repo = $repo
}

It 'Should have the new updated description' {
Expand All @@ -215,6 +228,9 @@ try
Context -Name 'For creating and getting a repository topic' -Fixture {
BeforeAll -ScriptBlock {
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -AutoInit

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$repo = $repo
}

It 'Should have the expected topic' {
Expand All @@ -240,6 +256,9 @@ try
Context -Name 'For getting repository languages' -Fixture {
BeforeAll -ScriptBlock {
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -AutoInit

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$repo = $repo
}

It 'Should be empty' {
Expand All @@ -263,6 +282,9 @@ try
Context -Name 'For getting repository tags' -Fixture {
BeforeAll -ScriptBlock {
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid) -AutoInit

# Avoid PSScriptAnalyzer PSUseDeclaredVarsMoreThanAssignments
$repo = $repo
}

It 'Should be empty' {
Expand Down

0 comments on commit 65c4a06

Please sign in to comment.