Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Comments regarding where to places mocks is wrong in one instance in unit_template.ps1 #160

Closed
johlju opened this issue Jul 30, 2016 · 0 comments
Assignees
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Contributor

johlju commented Jul 30, 2016

At row 47 and 48 in the file unit_template.ps1 is says

    # Mocks that should be applied to all cmdlets being tested may
    # also be created here if required.

This is wrong since those needs to be inside the Describe block. At least according to this error message when I tried to put them outside.

The Mock command may only be used inside a Describe block.
At C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\Describe.ps1:125 char:9

Either we remove this text, or if one is allowed to nest describe blocks, we could add a describe block to be able to mock at this location. Or if the text is meant for init-code like setting variables for later use in mocks, then the text should change to say that.

@kwirkykat kwirkykat added the bug The issue is a bug. label Aug 1, 2016
@KarolKaczmarek KarolKaczmarek self-assigned this Aug 1, 2016
kwirkykat added a commit that referenced this issue Aug 1, 2016
Removing incorrect mock instructions. Fixes #160
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants