I have some code (project source available here - https://github.com/natemurthy/testing-final-vals):
object Main extends App {
final val NAME = "foo"
}
And I'm using ScalaTest and the SBT Coverage plugin to test this code like so:
import org.scalatest.{FlatSpec,Matchers}
class MainTest extends FlatSpec with Matchers {
it should "have a name" in {
Main.NAME shouldBe "foo"
}
}
But for some reason I only get coverage points when I include a lazy
modifier in this expression:
Why is this the case?