Unit testing Scala

Unit TestingScalaTdd

Unit Testing Problem Overview


I just recently started learning the Scala language and would like to do it in TDD-way. Could you share your experiences on the unit testing frameworks there are for Scala and the pros/cons of them.

I'm using IntelliJ IDEA for Scala development, so it would be nice to be able to run the tests with IDE-support.

Unit Testing Solutions


Solution 1 - Unit Testing

Have you looked at ScalaTest ?

I've not used it, but it comes from Bill Venners and co at Artima, and consequently I suspect it'll do the job. It doesn't appear to have IDE integration, however.

This blog entry is a little old, but suggests that TestNG is the best option for testing Scala. TestNG will certainly have IDE integrations.

EDIT: I've just realised that I wrote this answer in 2009, and the world has moved on (!). I am currently using ScalaTest, the IDE integration works fine, and I can strongly recommend it. In particular the matcher DSL works very nicely

Solution 2 - Unit Testing

I'm the author of specs. If you're a Intellij user, I advise you to mix-in in the org.specs.runner.ScalaTest trait to your specification and run it as a ScalaTest suite.

If you have any issue with that, or anything else feel free to send a message to the specs-users mailing list.

Solution 3 - Unit Testing

You could also check out [Specs][1] it's fairly complete and IIRC is heavily used as part of Lift.

[1]: http://code.google.com/p/specs/ "Specs"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKaitsuView Question on Stackoverflow
Solution 1 - Unit TestingBrian AgnewView Answer on Stackoverflow
Solution 2 - Unit TestingEricView Answer on Stackoverflow
Solution 3 - Unit TestingSaemView Answer on Stackoverflow