Skip to content

Added Shoud-HaveParameter Assertion#1202

Merged
nohwnd merged 11 commits intopester:masterfrom
lipkau:feature/ShouldHaveParameter
Jan 21, 2019
Merged

Added Shoud-HaveParameter Assertion#1202
nohwnd merged 11 commits intopester:masterfrom
lipkau:feature/ShouldHaveParameter

Conversation

@lipkau
Copy link
Copy Markdown
Contributor

@lipkau lipkau commented Jan 9, 2019

1. General summary of the pull request

added assertion to test the parameters of a cmdlet

lipkau added 2 commits January 9, 2019 16:10
added assertion to test the parameters of a cmdlet
argument needs `= $true` value.
only PSv3+ imply `[Parameter(Mandatory)]` to be the same as [Parameter(Mandatory = $true)]
@nohwnd nohwnd changed the title Added Shoud-HaveParameter Assertion WIP: Added Shoud-HaveParameter Assertion Jan 9, 2019
@lipkau lipkau force-pushed the feature/ShouldHaveParameter branch 2 times, most recently from 3d5ca43 to 4b0e1ce Compare January 12, 2019 12:19
@lipkau lipkau force-pushed the feature/ShouldHaveParameter branch from 4b0e1ce to 1bfa2f0 Compare January 12, 2019 12:42
Added ValidateScript to the test function to ensure Tokenize can handle the groups properly
Fixed error message on psv2:

> ```
> RuntimeException: Method invocation failed because [System.Management.Automation.PSToken] doesn't contain a method named 'get_Item'.
> ```
@lipkau lipkau changed the title WIP: Added Shoud-HaveParameter Assertion Added Shoud-HaveParameter Assertion Jan 12, 2019
@lipkau
Copy link
Copy Markdown
Contributor Author

lipkau commented Jan 12, 2019

All green!

remind me not to contribute to modules that support psv2 😠

@nohwnd
Copy link
Copy Markdown
Member

nohwnd commented Jan 20, 2019

@lipkau I changed your api a bit, and fixed the names in the tests to be more descriptive. ok?

@lipkau
Copy link
Copy Markdown
Contributor Author

lipkau commented Jan 20, 2019

LGTM

@nohwnd nohwnd merged commit cd999fc into pester:master Jan 21, 2019
@lipkau lipkau deleted the feature/ShouldHaveParameter branch April 16, 2019 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants