这是我项目的结构
src
main
scala
com.abc
1.2
Album.scala
Artist.scala
test
scala
com.abc
1.2
AlbumTest.scala
规范文件
import org.scalatest._
class AlbumSpec extends FlatSpec {
it should "can add an Artist object to the album" in {
val album = Album("Thriller", 1981,Artist("Michael", "Jackson"))
}
}
Album.scala
case class Album (name: String, year: Int,artist: Artist)
Artist.scala
case class Artist(firstName: String, lastName: String)
我无法在规范文件
中创建相册和艺术家的对象IntelliJ版本:2017.2
Gradle版本:3.4.1
scalatest:scalatest_2.11:2.2.6
scala:2.11.6