LoginSignup
6
1

More than 5 years have passed since last update.

Functional Programming in Scala(Scala関数型デザイン&プログラミング)のExerciseでTDDを練習しよう!

Posted at

環境構築

公式のリポジトリをcloneして、sbtプロジェクトとしてIntelliJ IDEAにインポートしましょう。

build.sbtに1行追加します。

build.sbt
val commonSettings = Seq(
  scalaVersion := "2.12.1",
  libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test"
)

project/plugins.sbtを新しく作成します。

project/plugins.sbt
addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.3")

テストファイル作成

以下のようなテストファイルを作成しましょう。

exercises/src/test/scala/fpinscala/gettingstarted/GettingStartedSpec.scala
package fpinscala.gettingstarted

import org.scalatest._

class GettingStartedSpec extends FlatSpec {

// ここにテストコードを書く

}
6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1