This repository was archived by the owner on Jun 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1- Describe " E2E validation of PSGallery" {
1+ Describe " E2E validation of PSGallery" - Fixture {
22 BeforeAll {
33 $Repository = " InternalPSGallery"
44 $ModuleName = " FormatTools"
@@ -8,7 +8,7 @@ Describe "E2E validation of PSGallery" {
88 {
99 # the module is already installed
1010 $PSDefaultParameterValues [" It:skip" ] = $true
11- }
11+ }
1212 }
1313
1414 It " should return the same number of modules via cmdlets and website" {
Original file line number Diff line number Diff line change 1- Describe " Simple Validation of PSGallery" {
1+ Describe - Name " Simple Validation of PSGallery" {
22 It " The PowerShell Gallery should be responsive" {
33 $request = [System.Net.WebRequest ]::Create(" http://psget/psgallery" )
44 $response = $Request.GetResponse ()
Original file line number Diff line number Diff line change @@ -17,8 +17,19 @@ function Get-TestFromScript
1717 }, $true ) |
1818 ForEach-Object {
1919 # This is the name of the 'describe' block
20- $describeName = ($_.CommandElements | Where-Object { $_.StaticType.name -eq ' string' })[1 ].SafeGetValue()
21-
20+ for ($x = 0 ; $x -lt $_.CommandElements.Count ; $x ++ )
21+ {
22+ # Name parameter is named
23+ if ($_.CommandElements [$x ] -is [System.Management.Automation.Language.CommandParameterAst ] -and $_.CommandElements [$x ].ParameterName -eq ' Name' )
24+ {
25+ $describeName = $_.CommandElements [$x + 1 ].value
26+ }
27+ # if we have a string without a parameter name, return first hit. Name parameter is at position 0.
28+ ElseIf (($_.CommandElements [$x ] -is [System.Management.Automation.Language.StringConstantExpressionAst ]) -and ($_.CommandElements [$x - 1 ] -is [System.Management.Automation.Language.StringConstantExpressionAst ]))
29+ {
30+ $describeName = $_.CommandElements [$x ].value
31+ }
32+ }
2233 $item = [PSCustomObject ][ordered ]@ {
2334 Name = $describeName
2435 Tags = @ ()
You can’t perform that action at this time.
0 commit comments