Pending tests?

31 views
Skip to first unread message

cra...@gmail.com

unread,
Oct 20, 2014, 5:46:42 PM10/20/14
to pes...@googlegroups.com
rspec (a testing framework for Ruby) has a notion of a pending test.  Essentially, you've indicated that you plan to test an idea, but the test has not been implemented.

  describe Contact do
    it "is valid with a firstname, lastname and email"
    it "is invalid without a firstname"
  end


I tried a similar syntax in Pester:

    It "is a pending test"

which resulted in an  error:

 [-] Error occurred in Describe block 234ms
   No test script block is provided. (Have you put the open curly brace on the next line?)
   At \\vmware-host\Shared Folders\Documents\WindowsPowerShell\Modules\Pester\Functions\It.ps1:62 char:33


This syntax:

    It "is a pending test" {}

resulted in a passing test:

     [+] is a pending test 174ms

Is there a way to create pending tests in Pester?

Dave Wyatt

unread,
Oct 20, 2014, 7:39:01 PM10/20/14
to pes...@googlegroups.com
Not yet, but I believe nohwnd is looking into this for an update in the near future.  I'm not sure yet what the syntax will be.

The current logic of throwing an exception if no script block is present is probably a good thing to keep, just in case people try to put the open brace on the next line by mistake.  It'll probably look something like this:

It "is a pending test" -Pending

Where the Pending switch would exist in a different parameter set.
Reply all
Reply to author
Forward
0 new messages