scalatra / scalatra-sbt-prototype

A minimal Scalatra application with an SBT build to kickstart your project.
http://www.scalatra.org/
35 stars 18 forks source link

Request: Include a test servelet #4

Closed softwaregravy closed 12 years ago

softwaregravy commented 12 years ago

As a new user of scalatra, getting my ducks in order between sbt and import statements is giving me some trouble. I've trial and errored my way here.

Just need a working example with tests and having them passing. I'll try and offer a pull request once I figure it out.

rossabaker commented 12 years ago

This repository is generated from http://github.com/scalatra/scalatra-sbt.g8. Pull requests are better there, but if giter8 is a hassle, I can move it from here to there.

Whatever tests we have in this project should be our officially recommended test framework, and we don't have an official recommendation. We'll continue to support ScalaTest, Specs, and Specs2, but we should pick a favorite for the prototype. I lean toward Specs2, but am persuadable.

softwaregravy commented 12 years ago

I installed from giter8, it was fine.

I'm trying to get going on Specs2 (and hava included scalatra-specs2). Pretty sure I have everything in SBT working, just hunting for the right imports to put in my tests (e.g. hunting through scalatra-specs2 for the ScalatraSpecification class)

Just having the hello world building and testing in the prototype would help reduce the zero-to-writing code time.

PS thanks for this

On Wed, Nov 30, 2011 at 12:34 PM, Ross A. Baker < reply@reply.github.com

wrote:

This repository is generated from http://github.com/scalatra/scalatra-sbt.g8. Pull requests are better there, but if giter8 is a hassle, I can move it from here to there.

Whatever tests we have in this project should be our officially recommended test framework, and we don't have an official recommendation. We'll continue to support ScalaTest, Specs, and Specs2, but we should pick a favorite for the prototype. I lean toward Specs2, but am persuadable.


Reply to this email directly or view it on GitHub:

https://github.com/scalatra/scalatra-sbt-prototype/issues/4#issuecomment-2965837

rossabaker commented 12 years ago

I think one or the other of these is all that's needed:

import org.scalatra.test.specs2.ScalatraSpec
import org.scalatra.test.specs2.MutableScalatraSpec
softwaregravy commented 12 years ago

My error was I was trying to use ScalatraSpecification as per scalatra book: http://www.scalatra.org/2.0/book/#Specs (vs ScalatraSpec)

rossabaker commented 12 years ago

Ah, that's Specs1 instead of Specs2. I just opened a ticket on the book to clean that up: https://github.com/scalatra/scalatra-book/issues/13

softwaregravy commented 12 years ago

thanks