One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com
Using 89% of the same design the blog had in 2001.
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike,
always wear white.
As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.
Blogger is going to mangle whitespace again, but here goes... Yes, you can set up multiple Tags in Pester Describe blocks by passing arrays.
I should probably submit a pull for the Pester Wiki, just for fun (though not with this incredibly helpful code snippet. That'd be overkill).
By the way, am I the only person who sees a line like `Passed: 3 Failed: 0 Skipped: 0 Pending: 0` and often scans too quickly, seeing `3 Failed`? Wonder if `Passed: 3 - Failed: 0 - Skipped: 0 - Pending: 0` would be better. Otherwise, I'm liking 1.) Pester far too much, 2.) the time to write my PowerShell code with tests. Too many bugs found now that I'm doing TDD (okay, admittedly, here that's probably "Test Driven Debugging"), which is both good and depressing. ;^)
Describe -Tag "spam","ham" "testMe" { It "spam and ham" { $true | Should Be $true; } } Describe -Tag "spam" "testMe" { It "spam only" { $true | Should Be $true; } } Describe -Tag "ham" "testMe" { It "ham only" { $true | Should Be $true; } } ------------------------------ PS> Invoke-Pester Executing all tests in 'C:\something' Describing testMe [+] spam and ham 93ms Describing testMe [+] spam only 90ms Describing testMe [+] ham only 65ms Tests completed in 249ms Passed: 3 Failed: 0 Skipped: 0 Pending: 0 PS> Invoke-Pester -Tag "ham" Executing all tests in 'C:\something' Describing testMe [+] spam and ham 137ms Describing testMe [+] ham only 66ms Tests completed in 203ms Passed: 2 Failed: 0 Skipped: 0 Pending: 0 PS> Invoke-Pester -Tag "spam" Executing all tests in 'C:\something' Describing testMe [+] spam and ham 71ms Describing testMe [+] spam only 61ms Tests completed in 132ms Passed: 2 Failed: 0 Skipped: 0 Pending: 0
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity. About Our Author