fest-assert-2.x icon indicating copy to clipboard operation
fest-assert-2.x copied to clipboard

Iterables.assertContainsExactly should not throw ex. if 'actual' and 'values' are empty

Open mkarneim opened this issue 12 years ago • 5 comments

org.fest.assertions.internal.Iterables.assertContainsExactly(AssertionInfo info, Iterable<?> actual, Object[] values)

calls checkIsNotNullAndNotEmpty(values) and throws an IllegalArgumentException with message "The array of values to look for should not be empty" EVEN if values AND actual are empty.

But I would expect that it returns successfully.

  • Michael

(PS: Thanks for this great tool!)

mkarneim avatar Nov 13 '12 16:11 mkarneim

I agree, accepting empty values makes sense.

Thanks for reporting this, we will fix it in the 2.0 version.

joel-costigliola avatar Nov 17 '12 14:11 joel-costigliola

Great suggestion! Thanks Michael. The next milestone will fix this.

alexruiz avatar Jan 10 '13 15:01 alexruiz

Nice, thank you.

mkarneim avatar Jan 11 '13 05:01 mkarneim

same for org.fest.assertions.internal.Maps.assertContains ...

... and probably some more assertion methods.

aaschmid avatar Apr 03 '13 12:04 aaschmid

For your information, this issue has been fixed in AssertJ a fork of Fest Assert 2.0M10.

joel-costigliola avatar Apr 15 '13 09:04 joel-costigliola