Sebastian Schuberth
05/27/2026, 3:01 PM.shouldBeSingleton() actually return the singleton instead of the original (single-valued) collection? That would allow for nicer chaining of assertions, like .shouldBeSingleton().shouldBeSuccess().sam
05/27/2026, 3:34 PMsam
05/27/2026, 3:35 PMSebastian Schuberth
05/27/2026, 3:36 PMsam
05/27/2026, 3:37 PMsam
05/27/2026, 3:37 PMSebastian Schuberth
05/27/2026, 3:39 PMCLOVIS
05/27/2026, 3:48 PMList<T>.single(): T for that, so maybe shouldBeSingle() can be added without breaking the existing method?Sebastian Schuberth
05/27/2026, 3:49 PMsam
05/27/2026, 3:50 PMshouldBeSingleSebastian Schuberth
05/27/2026, 3:51 PMsam
05/27/2026, 3:51 PMsam
05/27/2026, 3:51 PMsam
05/27/2026, 3:52 PMsam
05/27/2026, 3:56 PMKlitos Kyriacou
05/28/2026, 5:07 PMshouldBeSingle. The original method could still be used like this:
actualCollection.shouldBeSingleton().shouldBeTypeInstanceOf<Set<X>>() shouldBe expectedCollection
Also, note that the original post could be written like this, using only existing methods:
actualCollection.shouldBeSingleton { it.shouldBeSuccess() }Olaf Gottschalk
06/19/2026, 1:55 PM