Closed robsonpeixoto closed 7 years ago
What version of IDEA are you using? Also can you try:
testCompile('org.jetbrains.spek:spek-api:1.1.2') {
exclude group: 'org.jetbrains.kotlin'
}
testCompile('org.jetbrains.spek:spek-junit-platform-engine:1.1.2') {
exclude group: 'org.jetbrains.kotlin'
}
Thanks, @raniejade. Now it's working.
I have no idea what's happened, but after closing the IDEA and reopen, everything is working well.
This is really needed? http://spekframework.org/docs/latest/#_using_later_versions_of_kotlin
The IDEA version.
IntelliJ IDEA 2017.2
Build #IU-172.3317.76, built on July 15, 2017
Licensed to Robson Peixoto
Subscription is active until December 2, 2017
JRE: 1.8.0_152-release-915-b5 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6
Good to know. Yes if you want to use the latest version of kotlin, spek's dependency will pull in an older version of kotlin.
@raniejade I think it's not necessary.
The gradle/maven should respect the priorities. The output of the command ./gradlew dependencies
testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.3-2
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2
| | \--- org.jetbrains:annotations:13.0
| \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3-2
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 (*)
+--- org.jetbrains.kotlin:kotlin-reflect:1.1.3-2
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 (*)
+--- org.jsoup:jsoup:1.10.3
+--- org.apache.httpcomponents:fluent-hc:4.5.3
| +--- org.apache.httpcomponents:httpclient:4.5.3
| | +--- org.apache.httpcomponents:httpcore:4.4.6
| | +--- commons-logging:commons-logging:1.2
| | \--- commons-codec:commons-codec:1.9
| \--- commons-logging:commons-logging:1.2
+--- uy.kohesive.klutter:klutter-core:2.2.+ -> 2.2.0
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.1.2 -> 1.1.3-2 (*)
| \--- org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2 -> 1.1.3-2 (*)
+--- org.jetbrains.kotlin:kotlin-test:1.1.3-2
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 (*)
+--- org.jetbrains.spek:spek-api:1.1.2
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.0.6 -> 1.1.3-2 (*)
| \--- org.jetbrains.kotlin:kotlin-reflect:1.0.6 -> 1.1.3-2 (*)
+--- org.jetbrains.spek:spek-junit-platform-engine:1.1.2
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.0.6 -> 1.1.3-2 (*)
| +--- org.jetbrains.kotlin:kotlin-reflect:1.0.6 -> 1.1.3-2 (*)
| \--- org.jetbrains.spek:spek-api:1.1.2 (*)
\--- org.junit.platform:junit-platform-launcher:1.0.0-M4
\--- org.junit.platform:junit-platform-engine:1.0.0-M4
+--- org.junit.platform:junit-platform-commons:1.0.0-M4
\--- org.opentest4j:opentest4j:1.0.0-M2
Yeah that's good as long as you also pull the correct version of kotlin-reflect
, it's not backward/forward compatible. In your case you specified the dependency for kotlin-reflect:1.1.3-2
, that's why it's working. Most of the time people don't need kotlin-reflect
so they just include the latest version of kotlin-stdlib
. Since spek pulls in an older version it's going to fail at runtime.
When I define a function as
internal
and run the test on the Intellij, I got the error below. But the command./gradlew clean test
works like a charm.build.gradle