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

path.FreeSpecLike cannot be cast to org.scalatest.path.FreeSpec #309

Closed
rconaway opened this issue May 4, 2014 · 3 comments
Closed

path.FreeSpecLike cannot be cast to org.scalatest.path.FreeSpec #309

rconaway opened this issue May 4, 2014 · 3 comments

Comments

@rconaway
Copy link

rconaway commented May 4, 2014

I'm trying to use path.FreeSpec with Akka. Because Akka's TestKit is a class, I have to use the trait version of path.FreeSpec: path.FreeSpecLike. However, at runtime I get an exception when the test class is cast to path.FreeSpec:

... cannot be cast to org.scalatest.path.FreeSpec

I was able to fix the problem locally by changing the cast to use the trait instead of the class at line 51 of FreeSpecLike.java:

override def newInstance: FreeSpecLike = this.getClass.newInstance.asInstanceOf[FreeSpecLike]

This problem was also in FunSpecLike and I suspect it's in the other traits.

I'm using ScalaTest 2.1.5, Scala 2.11.0, Akka 2.3.2.

@bvenners
Copy link
Contributor

bvenners commented May 4, 2014

Ah, that's a bug! We'll fix that and do a 2.1.6, because it will be binary compatible. I am away for the weekend with very spotty internet, so it will be early this coming week before I can release it, hopefully Monday.

Bill

@bvenners
Copy link
Contributor

bvenners commented May 7, 2014

Was quite busy running around today and only now got 2.1.6 released for 2.10. Will get it out for 2.11 tomorrow, as well as the release notes, etc. The only change it has is this bug fix.

https://oss.sonatype.org/content/groups/public/org/scalatest/scalatest_2.10/2.1.6/

@bvenners bvenners closed this as completed May 7, 2014
@bvenners
Copy link
Contributor

bvenners commented May 8, 2014

This fix is now also released for 2.11:

https://oss.sonatype.org/content/groups/public/org/scalatest/scalatest_2.11/2.1.6/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants