dimanche 21 décembre 2014

Scala tests in IntelliJ IDEA: Cannot resolve reference test with such signature

I'm trying to run a test for a simple Scala program. The method is called sayHello and is in a class demo.Hello.



package demo

class Hello {

def sayHello(name: String) = s"Hello, $name!";

}


I've created a test class for hello called HelloTest as below



package demo

import org.scalatest.FunSuite

class HelloTest extends FunSuite {
test("sayHello method works correctly") {
val hello = new Hello
hello.sayHello("Scala") == "Hello, Scala!"
}
}


The line test("sayHello method works correctly") seems to bring up the warning Unspecified value parameters :: Seq[Tag], 0 => BoxedUnit. So it seems like I'm missing a few parameters in the test(..) function. However, from all the use cases I can find, the tests name is only ever given inside the test(...) function. So what am I doing wrong? Any advice/tips would be appreciated.


1 commentaire: