How to know when to use `a`, `an` or `the` in ScalaTest Matchers when asserting exceptions?
Harit Himanshu

Harit Himanshu @harittweets

About: I am hands-on software professional with more than a decade of experience in building and shipping products at companies of small to large sizes. contributed in Advertising,CleanTech,Security,FinTech

Location:
Victoria, BC
Joined:
Sep 3, 2019

How to know when to use `a`, `an` or `the` in ScalaTest Matchers when asserting exceptions?

Publish Date: Nov 28 '19
3 0

I am reading the section on Testing Exceptions on ScalaTest documentation and looking at examples such as

an [IndexOutOfBoundsException] should be thrownBy s.charAt(-1)

I tested a and that works too

a [IndexOutOfBoundsException] should be thrownBy s.charAt(-1)

and

val thrown = the [IndexOutOfBoundsException] thrownBy s.charAt(-1)

I am confused and there is…

Comments 0 total

    Add comment