Questions tagged [specs2]

Executable software specification tool that specifies behaviour both at the class and application level using Scala.

specs2 is a library for writing executable software specifications in Scala.

547 questions
0
votes
1 answer

Trying to define Scalatra webservice with JSON parameters

I am trying to define a webservice, using Scalatra, where the parameters are passed in in the body, preferably as JSON, not having everything on the url, as I have it now. So, I would like this test to pass, but the commented out code is what passes…
James Black
  • 41,583
  • 10
  • 86
  • 166
0
votes
0 answers

Unit testing a Scalatra POST service with specs2

I am trying to use this test to test my webservice: "POST /phaseupdate" should { "return status 200" in { put("/phaseupdate", Map("filename" -> "test1", "entryaddress" -> "address 1","name" -> "starting","percentcomplete" -> "10")) { …
James Black
  • 41,583
  • 10
  • 86
  • 166
0
votes
2 answers

Fragment evaluation error when trying to run Play FakeAplication in scala test

Could someone please help. I have Play2 project in which I need to test some DAO code. I used documentaion from http://www.playframework.org/documentation/2.0.2/ScalaTest. The test is very simple: import models.Calendar import…
Siton
  • 1
0
votes
1 answer

Spec2 unit test is not compiling

I've written a median function and want to add some unit tests for it. So I wrote this in specs2 class TestStats extends Specification { "Median function " should { "be None for an empty list" in { Stats.median([]) must beNone } "be the…
Squidly
  • 2,707
  • 19
  • 43
-1
votes
1 answer

Test method that takes function literal in scala

I am using specs2 to test the following class class ConstraintSolver { def solve(solver: Solver)(callback: (ConstraintSolution) => Unit) = { val results = solver.solve() callback(ConstraintSolution(true, results)) } } case class…
Austen
  • 65
  • 7
-1
votes
1 answer

SBT don't run any Specs2 test in custom test configuration

I have a multiproject with some settings and custom configs shared between them. Those settings are configs that should run Specs2 tests by tag. However, when I run those new configs they aren't running any test at all. import…
Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64
-1
votes
1 answer

Wrong order of execution of tests

I have the following test code: import org.specs2.mutable.Specification import org.specs2.specification.{BeforeExample, Before, Scope} class TestSpec extends Specification with BeforeExample { def before = println("before!!!!") "Test" should…
sheh
  • 1,003
  • 1
  • 9
  • 31
1 2 3
36
37