g5lhaw
Last Updated: February 25, 2016
·
2.553K
· nirth

Specs with Maven and Scala

If you interested in using Scala's BDD framework – Specs with Scala 2.9.2+ and outputting result to maven JUnit runner you should first migrate to specs2 library since specs considered deprecated as of Scala 2.9.1.

Simply add
<!-- In properties declaration -->
<scala.version>2.9.2</scala.version>
<scala.test.specs2.version>1.12.1</scala.test.specs2.version>

<!-- In dependencies -->
<dependency>
  <groupId>org.specs2</groupId>
  <artifactId>specs2_${scala.version}</artifactId>
  <version>${scala.test.specs2.version}</version>
  <scope>test</scope>
</dependency>

Your specs should look like:

import org.specs2.mutable._;
import org.specs2.runner._;
import org.junit.runner._;

class MySpecTest extends SpecificationWithJUnit {
"My code should" should {

    "True and true must be true" in {
        true && true must_== true;
    }

            "False and false must be false" in {
        false && false must_== false;
    }
}
}

Source files/examples can be found at:
https://github.com/nirth/simple-csv/tree/65e2966ff0eaac364431e146fc0f0a41e5bf07ce or https://bitbucket.org/nirth/simple-csv/changeset/65e2966ff0eaac364431e146fc0f0a41e5bf07ce