Closed f0rt closed 3 years ago
There was elipsis originally, I am not sure why I commented it out. Is it better like this?
101 | Should -BeIn (1..10)
Expected collection @(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...90 more) to contain 101, but it was not found.
At C:\projects\pester_main\Functions\Assertions\Should.ps1:186 char:9
+ throw ( New-ShouldErrorRecord -Message $testResult.FailureMes ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (System.Collections.Hashtable:Hashtable) [], Exception
+ FullyQualifiedErrorId : PesterAssertionFailed
Looks good. Actually you can reverse the message because "101" is the object under test (not the collection):
Expected 101 to be one of the values in the collection @() ...
I won't change the order, the messages should have the same order in all assertions, and there is also -Because
that gets inserted into the message when user specifies it. :)
Now in 5.2.1 it prints Expected collection @(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...) to contain 101, but it was not found.
101 | Should -BeIn (1..100)
prints the following error message:
This is misleading since the expected set doesn't contain only 10 elements.