O'Reilly logo

Scalatra in Action by Stefan Ollinger Dave Hrycyszyn Ross A. Baker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Testing

This chapter covers

  • Integration testing with Specs2
  • Unit testing with Specs2
  • Testing with ScalaTest

By now, you’ve had a thorough introduction to the basic features of Scalatra. As good test-first developers, we feel a little guilty about waiting until now to introduce testing, but here we are.

Scalatra comes with a test DSL to simplify testing your application. The DSL follows the Scalatra philosophy of not being particularly opinionated. It works with both major Scala test frameworks, ScalaTest and Specs2. It’s suited to both integration and unit testing. And if it doesn’t fully suit your needs, it’s easy to pull out the pieces that do. It’s time to write your first test.

8.1. Integration testing with Specs2

Scalatra ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required