ticketmaster / poshspec

Infrastructure Testing DSL running in Pester
MIT License
183 stars 32 forks source link

Pester 4.x support - Allow for new syntax #42

Closed jvheaton closed 7 years ago

jvheaton commented 7 years ago

Pester 4.x adds new assertion syntax and current version of poshspec uses the 3.x syntax.

Describing WhatEver Context Services Checking Status [-] Error occurred in Context block 299ms RuntimeException: The It command may only be used from a Pester test script. at Assert-DescribeInProgress, C:\Program Files\WindowsPowerShell\Modules\Pester\4.0.2\Functions\Describe.ps1: line 200 at ItImpl, C:\Program Files\WindowsPowerShell\Modules\Pester\4.0.2\Functions\It.ps1: line 140 at It, C:\Program Files\WindowsPowerShell\Modules\Pester\4.0.2\Functions\It.ps1: line 117 at Invoke-PoshspecExpression, ..\Modules\poshspec\2.1.12\Private\Invoke-PoshspecExpression.ps1:

https://github.com/pester/Pester/issues/683

cdhunt commented 7 years ago

I have yet to test it, but the Should syntax is provided by you. On the surface, it appears you can update your test scripts to the new syntax if you are using 4.x. Based on that error, it does look like something else about how Pester executes the test has changed that doesn't have to do with the assertion syntax.

jvheaton commented 7 years ago

I think it was how I was calling the modules. Both Pester and PoshSpec were being called independently and sure if it was having issues with the built in Pester in Win 10. Will close the issue for now and let you know if I find anything else.