bbaldino
12/11/2020, 10:25 PMshouldBeInstanceOf
that took a block was that I ended up doing things like this:
someList.first().shouldBeInstanceOf<Foo> {
// 'it' is cast to 'Foo'
it.someMethodOnFoo() shouldBe ...
}
whereas now I end up doing something like
with (someList.first()) {
shouldBeInstanceOf<Foo>()
someMethodOnFoo() shouldBe ...
}
and I prefer the first style, but perhaps just a personal preference.sam
12/11/2020, 10:47 PMshouldBeInstanceOf
should smart castbbaldino
12/11/2020, 10:48 PMsam
12/11/2020, 10:49 PMbbaldino
12/11/2020, 10:54 PMwith
.Javier
12/11/2020, 10:54 PMshouldBeTypeOf()
doesn't smart cast too?