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 {
2
2
BeforeAll {
3
3
$Repository = " InternalPSGallery"
4
4
$ModuleName = " FormatTools"
@@ -8,7 +8,7 @@ Describe "E2E validation of PSGallery" {
8
8
{
9
9
# the module is already installed
10
10
$PSDefaultParameterValues [" It:skip" ] = $true
11
- }
11
+ }
12
12
}
13
13
14
14
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" {
2
2
It " The PowerShell Gallery should be responsive" {
3
3
$request = [System.Net.WebRequest ]::Create(" http://psget/psgallery" )
4
4
$response = $Request.GetResponse ()
Original file line number Diff line number Diff line change @@ -17,8 +17,19 @@ function Get-TestFromScript
17
17
}, $true ) |
18
18
ForEach-Object {
19
19
# 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
+ }
22
33
$item = [PSCustomObject ][ordered ]@ {
23
34
Name = $describeName
24
35
Tags = @ ()
You can’t perform that action at this time.
0 commit comments