Skip to content

Commit

Permalink
Check exception with isInstanceOf
Browse files Browse the repository at this point in the history
  • Loading branch information
fthomas committed Nov 29, 2021
1 parent 5d5c758 commit 4814e9f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import cats.effect.unsafe.implicits.global
import munit.FunSuite
import org.scalasteward.core.io.process.Args
import org.scalasteward.core.util.{DateTimeAlg, Nel}
import scala.concurrent.TimeoutException
import scala.concurrent.duration._

class processTest extends FunSuite {
Expand Down Expand Up @@ -43,7 +44,7 @@ class processTest extends FunSuite {
val p = slurp2(Nel.of("sleep", sleep.toSeconds.toInt.toString), timeout).attempt
val (Left(t), fd) = DateTimeAlg.create[IO].timed(p).unsafeRunSync()

assert(clue(t).toString.contains("TimeoutException"))
assert(clue(t).isInstanceOf[TimeoutException])
assert(clue(fd) > timeout)
assert(clue(fd) < sleep)
}
Expand Down

0 comments on commit 4814e9f

Please sign in to comment.