Specs2 support #485

Closed
fokot opened this Issue Nov 4, 2016 · 8 comments

Projects

None yet

6 participants

@fokot
fokot commented Nov 4, 2016

Hi guys, do you plan to support specs2 for testing.
I created simple specs2 support for testing routes. I can create a pull request. I didn't do it now as I'm not sure you would like to have new sub project in sbt etc. This is it also with usage example. Right now I support matchers only on entity as string but doing unmarshalling and also support for http codes etc. It is here https://gist.github.com/fokot/3827d2f0fc2cb02b3c4f65d8344f2f18

@ktoso
Member
ktoso commented Nov 4, 2016

That'd be cool, yes :-)
We're not that familiar with Specs2 (well Johannes is I think), but most of us not really.

Would be excellent if you could PR and maintain it in case of upgrades needed?

Yes, separate project is the way to go I think. Would also need docs :)

@viktorklang
Member
viktorklang commented Nov 4, 2016 edited

Or, if may I suggest, having it completely stand-alone, since supporting a
lot of different test fwks is not a core concern of the library itself?

@jonas
Contributor
jonas commented Nov 4, 2016

Ref (or duplicate) #232

@fokot
fokot commented Nov 4, 2016

@viktorklang having it in this repo might be easier for publishing to maven central.. I'm not familiar with that at all. But if you want I can create a stand-alone project. Or I can just create a blog post with this gist, so ppl know how to test routes with specs2.. So options are:

  1. new project in akka-http
  2. standalone project
  3. blog
  4. nothing (it's easy for anyone to figure it out)
@jrudolph
Member
jrudolph commented Nov 7, 2016

We had support for specs2 in spray-testkit which was just a few lines. I would not be concerned about maintaining it if someone could contribute it and if it would be the same amount of glue code.

In spray, we referenced specs2 as a provided dependency so it wouldn't be pulled in automatically.

Here's the Scalatest support in akka-http-testkit:

https://github.com/akka/akka-http/blob/master/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/ScalatestUtils.scala

Here's the former specs2 support in spray:

https://github.com/spray/spray/blob/master/spray-testkit/src/main/scala/spray/testkit/Specs2Interface.scala

@ktoso
Member
ktoso commented Dec 4, 2016

I agree with @jrudolph. It's something we had, and now don't, which makes upgrading harder for people (which we want, a lot), thus we should add it back.

Very happy to accept a PR if you'd have the time @fokot !

@sergiuszkierat
Contributor

yes, it would be nice to have specs2 support again.

//FIXME: trait Specs2RouteTest extends RouteTest with Specs2Interface

https://github.com/akka/akka-http/blob/master/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTest.scala#L171

@ktoso
Member
ktoso commented Dec 9, 2016

PR certainly welcome. We won't get to it personally in the akka team I have a feeling (more urgent things around)

@tom-walford tom-walford added a commit to tom-walford/akka-http that referenced this issue Jan 16, 2017
@tom-walford tom-walford Add support for Specs2 in testkit #485
* Add support for Specs2 tests using the trait Specs2RouteTest in the same form as ScalatestRouteTest
472aed6
@jonas jonas added this to the 10.0.2 milestone Jan 19, 2017
@tom-walford tom-walford added a commit to tom-walford/akka-http that referenced this issue Jan 21, 2017
@tom-walford tom-walford Add support for Specs2 in testkit #485
* Add support for Specs2 tests using the trait Specs2RouteTest in the same form as ScalatestRouteTest
* Added copyright notices in Specs2Utils and Specs2RouteTestSpec
* Updated testkit.md doc to include note about Specs2 support, and linked to the
 appropriate test (thanks jonas!)
* Updated dependencies - moved specs2 to the Test section and added license info
Added example use of Testkit with Specs2.
bdf4409
@ktoso ktoso closed this Jan 26, 2017
@ktoso ktoso removed the 1 - triaged label Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment