Why to have a quick way to run minimal projects

Sometimes you just want to do a proof of concept or try something quick, that’s why it is a good idea to have a quick way to test things.

Sometimes the REPL, irb for Ruby or scala for Scala, is just not enough.

This post explain how to create a minimal project for Scala, with ScalaTest Library already setup.

Prequisites

  • Java 8 JDK
javac -version
  • sbt
sbt sbtVersion

Create the project

  1. On the command line, create or go to the directory where your projects reside

  2. Execute

sbt new scala/scalatest-example.g8
  1. Choose an arbitrary name for the project

Check everything is going well

  1. Go to the project folder
cd ${projectName}
  1. Clean, Compile, Test and Run the project
sbt clean compile test run

References