scalatest / scalatest

A testing tool for Scala and Java developers
Apache License 2.0
1.15k stars 335 forks source link

ScalaTest within SBT doesn't work with Scala 2.12.5 #1342

Open dhinojosa opened 6 years ago

dhinojosa commented 6 years ago

After upgrading an SBT project with Scala 2.12.5:

To recreate, create an SBT project, create a FunSuite test, and bring in ScalaTest 3.0.5, and run a test.

You will receive message that look like the following:

[error] /Users/danno/Development/scala_programming_fundamentals_1/src/test/scala/MethodsSpec.scala:9:16: value should is not a member of Int
[error]      foo(4, 5) should be (9)
[error]                ^
[error] /Users/danno/Development/scala_programming_fundamentals_1/src/test/scala/MethodsSpec.scala:4:66: could not find implicit value for parameter pos: org.scalactic.source.Position
[error]    test("In review, a method is structured like the following:") {
dhinojosa commented 6 years ago

I put in the ExampleSpec from the front page from ScalaTest.org, that didn't work either. But when I downgraded to 2.12.4 it worked fine.

bvenners commented 6 years ago

Oh oh. We'll investigate.

dhinojosa commented 6 years ago

Workaround: Use 2.12.4, or if you wish to use 2.12.5, then use JDK 8 and not JDK 9 or 10. The Scala website for the download of 2.12.5 references this issue (maybe):

http://scala-lang.org/news/2.12.5 and links (Albeit not hyperlinked) to https://github.com/scala/scala-dev/issues/480

bvenners commented 6 years ago

Ah, I see. Yes, I just tried with JDK8 and 2.12.5 works fine on the example from the scalatest.org home page.

SethTisue commented 6 years ago

this was Scala 2.12.5's fault. Scala 2.12.6 is out now with a fix. this ticket can be closed.

djx314 commented 4 years ago

Now the bug is reproducted in scalatest 3.1.0 and scala 2.12.10

SethTisue commented 4 years ago

@djx314 can you provide reproduction details? lots of people are using that combination without problems, so whatever you're experiencing must be something more specific

djx314 commented 4 years ago

@SethTisue Sorry for that I finally find that is coursier not download this dependency. I delete the temp ivy directory is OK.