I am newbie to scala
My sbt version is : 0.13.17
My Scala version is : Scala code runner version 2.12.6 -- Copyright 2002-2018, LAMP/EPFL and Lightbend, Inc.
I am trying to run the test case with the following code
class TestSpec extends WordSpec with Matchers with MockFactory with OneAppPerSuite {
"it" should {
"add 2 numbers" in new Testing() {
val a = 2
val b = 3
val expected = 5
val result: Int = add(2, 3)
result shouldEqual expected
}
}
trait Testing {
def add(a: Int, b: Int): Int = {
a + b
}
}
}
And i get the following error
discarded non-Unit value
"add 2 numbers" in new Testing() {
In my build.sbt file i see this
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused
I cant remove the above line and how do i make sure my test case executes.
I have gone through this link Suppress "discarded non-Unit value" warning. But not sure what needs to be done. Any help is highly appreciated