I want to make sure every resource in the plan file adheres to one of these 3 naming conventions. I may add more conventions in the future. I got the following scenario that works:
Scenario: Ensure that resource names follow naming conventions
Gives I have resources defined
When it has name
Then it must have name
Then its value must match the "([a-z]{2}aip(dev|test|uat|prod)[a-z]{3})|([a-z]{2,4}-aip-(dev|test|uat|prod))|([a-z]{2,4}-aip-([a-z]{2})-(dev|test|uat|prod))" regex
However its not very readable. Is there a better way of writing this that potentially would involve an example table? It needs to match one of them. If a resource does not match any of these then the test should throw a fail.
I have the following reg ex which matches on multiple naming conventions:
I want to make sure every resource in the plan file adheres to one of these 3 naming conventions. I may add more conventions in the future. I got the following scenario that works:
However its not very readable. Is there a better way of writing this that potentially would involve an example table? It needs to match one of them. If a resource does not match any of these then the test should throw a fail.