Upgrade specs2
This PR uses specs2-5.x for Scala 3 and specs2-4.x for Scala 2. Both versions support the new MacrotaskExecutor execution context.
Note that the PR will be updated with specs2-5.0.0 when an official version will be released.
@etorreborre thanks for moving so fast on these PRs! I think to release we'll have to make a separate module and/or a version bump ... in which case, instead of emphasizing source compatibility, aren't there several improvements we can make to the implementation to take advantage of new specs2 v5 features? @djspiewak mentioned that at least CatsResource could be reworked.
Yeah I think we almost need to split this away as a separate project. The problem is that version 4 is Scala 2 only, while version 5 is Scala 3 only, and they aren't source compatible so I'm pretty leery about trying to do a version switch like what is in this PR. However, going Scala 3 only is a big jump, and it probably makes sense to do that in a Specs2-specific module.
So maybe we need a specs2-cats-effect? Arguably that's a better approach anyway given the nature of this kind of interop.
Also yes, definitely, the Resource support can be made dramatically nicer if fragments are always async now!
I already extracted a specs2-cats project with the matchers which were depending on cats data types: https://github.com/etorreborre/specs2-cats. Maybe I can move over the rest of the cats-effect testing support for specs2?
About resources, I added a Resource trait in specs2. It has the advantage of being able to keep resources available across several specifications executions. So you can make a trait allocating / releasing resources, inherit it in several specifications, and use the same resource whether you execute one specification or several.
I already extracted a
specs2-catsproject with the matchers which were depending oncatsdata types: https://github.com/etorreborre/specs2-cats. Maybe I can move over the rest of thecats-effecttesting support for specs2?
That sounds great! I didn't realize specs2-cat also includes matches for IO, in which case this sounds like the perfect home. I'd be happy to help out with this, and also add a cross-build for JS.
@armanbilge fantastic, please do :-)