pester/Pester — pull request #175 by dlwyatt (2014-08-04 16:05:27+00:00)
Title: Single assertion per should

As discussed recently in issue #121, the current behavior of `Should` is to call the assertion function (`PesterBe`, etc) once for every input object in the pipeline, which may not always be desirable. This branch makes things more natural by only calling `PesterBe` (etc) once for each call to `Should`, passing in the entire pipeline input set as the value.

`PesterBe` and `PesterBeExactly` have been updated to take advantage of this new behavior, and are now wrappers around the `Compare-Object` cmdlet instead of the `-eq` or `-ceq` operators.

There's probably still more to be done in this branch before it is merged. For instance, how should the other operators behave when multiple input objects are provided? `Should Exist` and `Should Contain` make no sense for an array. Should they produce an error, or should they enumerate the array and perform a single test on each element? (Thus emulating how things work today; the difference being that it's up to the individual assertion operators to decide how they want to handle multiple inputs, instead of `Should` forcing this behavior on them.)