Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specs2 support #485

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

Specs2 support #485

fokot opened this issue Nov 4, 2016 · 8 comments
Labels
help wanted Identifies issues that the core team will likely not have time to work on t:testing Issues related to the akka-http-testkit module
Milestone

Comments

@fokot
Copy link

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
Copy link
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 :)

@ktoso ktoso added help wanted Identifies issues that the core team will likely not have time to work on 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:testing Issues related to the akka-http-testkit module labels Nov 4, 2016
@viktorklang
Copy link
Member

viktorklang commented Nov 4, 2016

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
Copy link
Member

jonas commented Nov 4, 2016

Ref (or duplicate) #232

@fokot
Copy link
Author

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
Copy link
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
Copy link
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
Copy link
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
Copy link
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 added a commit to tom-walford/akka-http that referenced this issue Jan 16, 2017
* Add support for Specs2 tests using the trait Specs2RouteTest in the same form as ScalatestRouteTest
@jonas jonas added this to the 10.0.2 milestone Jan 19, 2017
tom-walford added a commit to tom-walford/akka-http that referenced this issue Jan 21, 2017
* 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.
@ktoso ktoso closed this as completed Jan 26, 2017
@ktoso ktoso removed the 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted label Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Identifies issues that the core team will likely not have time to work on t:testing Issues related to the akka-http-testkit module
Projects
None yet
Development

No branches or pull requests

6 participants