Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-ShouldOperator reference docs do not specify parameter interface for Test scriptblock #95

Closed
sean-r-williams opened this issue Dec 23, 2020 · 1 comment · Fixed by #129

Comments

@sean-r-williams
Copy link

  • Pester version: 5.1.0
  • Function: Add-ShouldOperator

General summary of the issue

The documentation for Add-ShouldOperator indicates that the -Test parameter is supposed to receive a [ScriptBlock] containing the assertion to be run. However, there isn't any documentation on how to pass in test/reference values, etc. etc. (either from the pipeline or via named/positional parameters).

I was able to find a blog post that partially covered it in passing, but some in-module documentation would be really useful here.

Some questions that a user should be able to answer from the documentation (either via examples or from the text itself) are:

  • How can I define a parameter in my test block such-that it's exposed to users when they call it via Should?
  • Are there any required/special-use parameters (e.g. $Negate)?
  • Are there any special steps required for receiving pipeline input from Should?
@nohwnd nohwnd transferred this issue from pester/Pester Mar 4, 2021
@nohwnd
Copy link
Member

nohwnd commented Mar 4, 2021

Thanks for reporting, you are right. That blogpost is great and I used it often. We should definintely document it here. Here is my talk on the topic that can be used as another source of info: https://www.youtube.com/watch?v=WYw23cGoKco&ab_channel=PowerShellConferenceEU

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 a pull request may close this issue.

2 participants