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

Nested mutable examples not running with Scala 2.13 #757

Open
jroper opened this issue Jul 19, 2019 · 4 comments
Open

Nested mutable examples not running with Scala 2.13 #757

jroper opened this issue Jul 19, 2019 · 4 comments

Comments

@jroper
Copy link

@jroper jroper commented Jul 19, 2019

This spec here:

https://github.com/jroper/play-geojson/blob/master/src/test/scala/au/id/jazzy/play/geojson/ExampleSpec.scala

Has examples nested two deep (ie, "foo" should { "do something" in { "bar" in { ... } } }. Using specs 4.6.0, this runs fine with Scala 2.11 and 2.12, but with 2.13, it doesn't run at all, it's as if the specs aren't there. Not sure if this is a Scala issue, specs2 issue, or if it's by design with Scala 2.13 and I need to update my specs.

@symbiont-eric-torreborre

This comment has been minimized.

Copy link
Contributor

@symbiont-eric-torreborre symbiont-eric-torreborre commented Jul 20, 2019

Hi James, I'm on holidays at the moment for 10 more days. I will have a look at that when I come back and unfortunately I have no idea of what is wrong there (also kind of annoyed that the current test suite does not cover this case)

@etorreborre

This comment has been minimized.

Copy link
Owner

@etorreborre etorreborre commented Jul 20, 2019

Actually I couldn't resist having a quick look. It seems that changing object ExampleSpec to class ExampleSpec fixes the issue. At least you have a work-around and I have a small reproducible case to investigate.

@jroper

This comment has been minimized.

Copy link
Author

@jroper jroper commented Jul 22, 2019

Thanks @etorreborre! Please enjoy your holiday, don't let my problems get in your way :)

jroper added a commit to jroper/play-geojson that referenced this issue Jul 22, 2019
To work around etorreborre/specs2#757.
@etorreborre

This comment has been minimized.

Copy link
Owner

@etorreborre etorreborre commented Jul 29, 2019

Wow, I need further investigation but it seems that Scala 2.12 was actually buggy w.r.t the initialization of objects where the code in the body of an object would run twice and this would discover the spec fragments properly. Whereas in 2.13 the initialization of an object is done only once and now the code discovering the fragments is buggy. This can only encourage me to remove that complicated code which was only there to support a marginal feature.

jtjeferreira added a commit to jtjeferreira/scalaxb that referenced this issue Aug 25, 2019
fix tests to be class instead of object (see etorreborre/specs2#757)
Shadowfiend added a commit to lift/framework that referenced this issue Sep 15, 2019
Scala 2.13's singleton body evaluation semantics have changed, leading
to a failure to discover fragments inside a singleton spec (see
etorreborre/specs2#757).
Shadowfiend added a commit to lift/framework that referenced this issue Oct 10, 2019
Scala 2.13's singleton body evaluation semantics have changed, leading
to a failure to discover fragments inside a singleton spec (see
etorreborre/specs2#757).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.