A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/microsoft/PowerShellForGitHub/commit/f31d79133df1310fac1f14643eea4cdb4972a26a below:

Fix pipeline support and testing for New-GitHubRepositoryFromTemplate… · microsoft/PowerShellForGitHub@f31d791 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+36

-3

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+36

-3

lines changed Original file line number Diff line number Diff line change

@@ -364,6 +364,7 @@ filter New-GitHubRepositoryFromTemplate

364 364 365 365

$elements = Resolve-RepositoryElements -BoundParameters $PSBoundParameters

366 366

$OwnerName = $elements.ownerName

367 +

$RepositoryName = $elements.repositoryName

367 368 368 369

$telemetryProperties = @{

369 370

RepositoryName = (Get-PiiSafeString -PlainText $RepositoryName)

Original file line number Diff line number Diff line change

@@ -321,16 +321,48 @@ try

321 321

}

322 322 323 323

$repo = New-GitHubRepositoryFromTemplate @newGitHubRepositoryFromTemplateParms

324 +

Start-Sleep -Seconds 1 # To work around a delay that GitHub may have with generating the repo

324 325

}

325 326 326 -

It 'Should support pipeline input for the uri parameter' {

327 +

It 'Should have the expected type and addititional properties' {

328 +

$repo.PSObject.TypeNames[0] | Should -Be 'GitHub.Repository'

329 +

$repo.name | Should -Be $repoName

330 +

$repo.private | Should -BeFalse

331 +

$repo.owner.login | Should -Be $script:ownerName

332 +

$repo.description | Should -Be $newRepoDesc

333 +

$repo.is_template | Should -BeFalse

334 +

$repo.RepositoryId | Should -Be $repo.id

335 +

$repo.RepositoryUrl | Should -Be $repo.html_url

336 +

}

337 + 338 +

It 'Should have created a .gitignore file' {

339 +

{ Get-GitHubContent -Uri $repo.svn_url -Path '.gitignore' } | Should -Not -Throw

340 +

}

341 + 342 +

It 'Should have created a LICENSE file' {

343 +

{ Get-GitHubContent -Uri $repo.svn_url -Path 'LICENSE' } | Should -Not -Throw

344 +

}

345 + 346 +

AfterAll {

347 +

if (Get-Variable -Name repo -ErrorAction SilentlyContinue)

348 +

{

349 +

Remove-GitHubRepository -Uri $repo.svn_url -Confirm:$false

350 +

}

351 +

}

352 +

}

353 + 354 +

Context 'When creating a public repository from a template (via pipeline input)' {

355 +

BeforeAll {

356 +

$repoName = ([Guid]::NewGuid().Guid)

357 +

$newRepoDesc = 'New Repo Description'

327 358

$newGitHubRepositoryFromTemplateParms = @{

328 359

TargetOwnerName = $ownerName

329 360

TargetRepositoryName = $repoName

361 +

Description = $newRepoDesc

330 362

}

331 363 332 -

{ $templateRepo | New-GitHubRepositoryFromTemplate @newGitHubRepositoryFromTemplateParms -WhatIf } |

333 -

Should -Not -Throw

364 +

$repo = $templateRepo | New-GitHubRepositoryFromTemplate @newGitHubRepositoryFromTemplateParms

365 +

Start-Sleep -Seconds 1 # To work around a delay that GitHub may have with generating the repo

334 366

}

335 367 336 368

It 'Should have the expected type and addititional properties' {

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4