diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a3ca38..20c2ff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,6 @@ name: CI -on: - push: - branches: - - "*" - - "!master" +on: pull_request jobs: validate: diff --git a/README.md b/README.md index f01502a..57b1d95 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ function New-ResourceGroupRequirement { [string]$Location ) - New-RequirementGroup "rg" { + New-RequirementGroup "rg" -ScriptBlock { @{ Describe = "Logged in to Azure" Test = { Get-AzAccount } @@ -283,14 +283,14 @@ New-RequirementGroup "local" { Set = { ... } } } -} | Invoke-Requirement | Format-Checklist +} New-RequirementGroup "cloud" { @{ Describe = "Terraform is deployed" Test = { ... } Set = { ... } } -} | Invoke-Requirement | Format-Checklist +} ``` The above example would result in the Requirements below. diff --git a/src/interface.ps1 b/src/interface.ps1 index 9512449..1f5a7f2 100644 --- a/src/interface.ps1 +++ b/src/interface.ps1 @@ -137,7 +137,9 @@ function New-RequirementGroup { Param( # The namespace identifier [Parameter(Mandatory, Position = 0)] - [string]$Namespace, + [Alias("Namespace")] + [ValidateNotNullOrEmpty()] + [string]$Name, # A scriptblock that writes Requirements to output when invoked [Parameter(Mandatory, Position = 1, ParameterSetName = "scriptblock")] [ValidateNotNullOrEmpty()] diff --git a/test/integration/Format-Checklist.Set.txt b/test/integration/Format-Checklist.Set.txt index 77c8c0a..7f7d090 100644 --- a/test/integration/Format-Checklist.Set.txt +++ b/test/integration/Format-Checklist.Set.txt @@ -1,3 +1,3 @@ - 09:44:13 ns>MyDescribe + 11:58:32 ns>MyDescribe -√ 09:44:13 ns>MyDescribe +√ 11:58:32 ns>MyDescribe diff --git a/test/integration/Format-Checklist.Test.txt b/test/integration/Format-Checklist.Test.txt index 77c8c0a..7f7d090 100644 --- a/test/integration/Format-Checklist.Test.txt +++ b/test/integration/Format-Checklist.Test.txt @@ -1,3 +1,3 @@ - 09:44:13 ns>MyDescribe + 11:58:32 ns>MyDescribe -√ 09:44:13 ns>MyDescribe +√ 11:58:32 ns>MyDescribe diff --git a/test/integration/Format-Checklist.TestSet.txt b/test/integration/Format-Checklist.TestSet.txt index 77c8c0a..7f7d090 100644 --- a/test/integration/Format-Checklist.TestSet.txt +++ b/test/integration/Format-Checklist.TestSet.txt @@ -1,3 +1,3 @@ - 09:44:13 ns>MyDescribe + 11:58:32 ns>MyDescribe -√ 09:44:13 ns>MyDescribe +√ 11:58:32 ns>MyDescribe diff --git a/test/integration/Format-Table.Set.txt b/test/integration/Format-Table.Set.txt index e24bdba..f664fb5 100644 --- a/test/integration/Format-Table.Set.txt +++ b/test/integration/Format-Table.Set.txt @@ -1,6 +1,6 @@ -Date Method State Result Requirement ----- ------ ----- ------ ----------- -12/2/19 9:44:13 PM Set Start ns>MyDescribe -12/2/19 9:44:13 PM Set Stop True ns>MyDescribe +Date Method State Result Requirement +---- ------ ----- ------ ----------- +12/3/19 11:58:32 AM Set Start ns>MyDescribe +12/3/19 11:58:32 AM Set Stop True ns>MyDescribe diff --git a/test/integration/Format-Table.Test.txt b/test/integration/Format-Table.Test.txt index 2ee21b7..9d58ce2 100644 --- a/test/integration/Format-Table.Test.txt +++ b/test/integration/Format-Table.Test.txt @@ -1,6 +1,6 @@ -Date Method State Result Requirement ----- ------ ----- ------ ----------- -12/2/19 9:44:13 PM Test Start ns>MyDescribe -12/2/19 9:44:13 PM Test Stop True ns>MyDescribe +Date Method State Result Requirement +---- ------ ----- ------ ----------- +12/3/19 11:58:32 AM Test Start ns>MyDescribe +12/3/19 11:58:32 AM Test Stop True ns>MyDescribe diff --git a/test/integration/Format-Table.TestSet.txt b/test/integration/Format-Table.TestSet.txt index fa631e7..68cc4d8 100644 --- a/test/integration/Format-Table.TestSet.txt +++ b/test/integration/Format-Table.TestSet.txt @@ -1,10 +1,10 @@ -Date Method State Result Requirement ----- ------ ----- ------ ----------- -12/2/19 9:44:13 PM Test Start ns>MyDescribe -12/2/19 9:44:13 PM Test Stop False ns>MyDescribe -12/2/19 9:44:13 PM Set Start ns>MyDescribe -12/2/19 9:44:13 PM Set Stop True ns>MyDescribe -12/2/19 9:44:13 PM Validate Start ns>MyDescribe -12/2/19 9:44:13 PM Validate Stop True ns>MyDescribe +Date Method State Result Requirement +---- ------ ----- ------ ----------- +12/3/19 11:58:32 AM Test Start ns>MyDescribe +12/3/19 11:58:32 AM Test Stop False ns>MyDescribe +12/3/19 11:58:32 AM Set Start ns>MyDescribe +12/3/19 11:58:32 AM Set Stop True ns>MyDescribe +12/3/19 11:58:32 AM Validate Start ns>MyDescribe +12/3/19 11:58:32 AM Validate Stop True ns>MyDescribe diff --git a/test/integration/Format-Verbose.Set.txt b/test/integration/Format-Verbose.Set.txt index 4c72575..0ef9045 100644 --- a/test/integration/Format-Verbose.Set.txt +++ b/test/integration/Format-Verbose.Set.txt @@ -1,2 +1,2 @@ -2019-12-02 21:44:13 Set Start ns>MyDescribe -2019-12-02 21:44:13 Set Stop ns>MyDescribe +2019-12-03 11:58:32 Set Start ns>MyDescribe +2019-12-03 11:58:32 Set Stop ns>MyDescribe diff --git a/test/integration/Format-Verbose.Test.txt b/test/integration/Format-Verbose.Test.txt index ba7ce45..0179c33 100644 --- a/test/integration/Format-Verbose.Test.txt +++ b/test/integration/Format-Verbose.Test.txt @@ -1,2 +1,2 @@ -2019-12-02 21:44:13 Test Start ns>MyDescribe -2019-12-02 21:44:13 Test Stop ns>MyDescribe +2019-12-03 11:58:32 Test Start ns>MyDescribe +2019-12-03 11:58:32 Test Stop ns>MyDescribe diff --git a/test/integration/Format-Verbose.TestSet.txt b/test/integration/Format-Verbose.TestSet.txt index fd9b1ce..dba3fed 100644 --- a/test/integration/Format-Verbose.TestSet.txt +++ b/test/integration/Format-Verbose.TestSet.txt @@ -1,6 +1,6 @@ -2019-12-02 21:44:13 Test Start ns>MyDescribe -2019-12-02 21:44:13 Test Stop ns>MyDescribe -2019-12-02 21:44:13 Set Start ns>MyDescribe -2019-12-02 21:44:13 Set Stop ns>MyDescribe -2019-12-02 21:44:13 Validate Start ns>MyDescribe -2019-12-02 21:44:13 Validate Stop ns>MyDescribe +2019-12-03 11:58:32 Test Start ns>MyDescribe +2019-12-03 11:58:32 Test Stop ns>MyDescribe +2019-12-03 11:58:32 Set Start ns>MyDescribe +2019-12-03 11:58:32 Set Stop ns>MyDescribe +2019-12-03 11:58:32 Validate Start ns>MyDescribe +2019-12-03 11:58:32 Validate Stop ns>MyDescribe