scalatest-junit4runner is a JUnit4 Runner for ScalaTest
It lets you run ScalaTests from both Maven and your JUnit4 enabled IDE by annotating your tests as shown in the example below
Install
git clone git://github.com/teigen/scalatest-junit4runner.git
cd scalatest-junit4runner
mvn clean install
Add as a dependency
com.jteigen.scalatest
junit4runner
1.0-SNAPSHOT
test
Use
import com.jteigen.scalatest.JUnit4Runner
import org.junit.runner.RunWith
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.Spec@RunWith(classOf[JUnit4Runner])
ignore(“should ignore”){ 1 + 1 should be (3) // doesn’t fail as the test is ignored } it(“should crash and burn!”){ 1 + 1 should be (3) } }
class SimpleTest extends Spec with ShouldMatchers {
describe(“Demo”){
it(“should run”){
1 + 1 should be (2)
}}