https://kotlinlang.org logo
Title
h

Hexa

11/04/2018, 11:08 AM
does anyone know why would this result to
undefine
when I'm expecting it should be either
true
or
false
?
obj shouldBe instanceOf(SomeClass::class)
k

kr3v

11/04/2018, 12:08 PM
As far as I can see, because
shouldBe
works like assertions, so it will throw an
AssertionError
.
shouldBe
is close to
assert obj instanceOf SomeClass
h

Hexa

11/04/2018, 12:10 PM
thanks
is
obj should beInstanceOf(SomeClass::class))
sufficient enough in this case?
I just want to check if obj is instance of SomeClass
k

kr3v

11/04/2018, 12:21 PM
Then you can simply write
obj is SomeClass
, not sure that external libs should be used in such case
h

Hexa

11/04/2018, 1:00 PM
yea maybe that makes more sense. its just im using KotlinTest Shoudlspec
so I thought I should use that external libs in this case