snowe
04/27/2017, 8:25 PMINFO: Discovered TestEngines with IDs: [spek, junit-jupiter]
Running sample.SampleSpec
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec <<< FAILURE! - in sample.SampleSpec
JUnit Jupiter Time elapsed: 0.01 sec <<< FAILURE!
null
snowe
04/27/2017, 8:25 PMsnowe
04/27/2017, 8:25 PMclass SampleSpec : Spek({
given("some context") {
on("executing some action") {
it("should pass") {
assertEquals(2, 2)
}
}
}
})
snowe
04/27/2017, 8:32 PMthanh
04/30/2017, 2:29 AMhhariri
robfletcher
05/08/2017, 4:34 PMsubject
and itBehavesLike
features mentioned here http://spekframework.org/docs/latest/#_subjects part of a future release? I don’t see them in the 1.1.1 APIrobfletcher
05/08/2017, 11:02 PMraniejade
05/11/2017, 12:07 AMorg.junit.platform:junit-platform-launcher:1.0.0-M4
in your test classpath.jmfayard
05/12/2017, 5:43 AMjackmiras
05/12/2017, 7:47 PMException in thread "main" java.lang.AbstractMethodError: Method org/jetbrains/spek/engine/Scope$Group.getType()Lorg/junit/platform/engine/TestDescri
ptor$Type; is abstract
at org.jetbrains.spek.engine.Scope$Group.getType(Scope.kt)
at org.junit.platform.launcher.TestIdentifier.from(TestIdentifier.java:60)
at org.junit.platform.launcher.TestPlan.lambda$from$0(TestPlan.java:78)
at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:245)
at org.junit.platform.engine.TestDescriptor.lambda$accept$0(TestDescriptor.java:247)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.junit.platform.engine.TestDescriptor.accept(TestDescriptor.java:247)
at org.junit.platform.launcher.TestPlan.lambda$from$1(TestPlan.java:79)
at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608)
at org.junit.platform.launcher.TestPlan.from(TestPlan.java:79)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:130)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:87)
at org.junit.platform.console.tasks.ConsoleTestExecutor.executeTests(ConsoleTestExecutor.java:65)
at org.junit.platform.console.tasks.ConsoleTestExecutor.lambda$execute$0(ConsoleTestExecutor.java:57)
at org.junit.platform.console.tasks.CustomContextClassLoaderExecutor.invoke(CustomContextClassLoaderExecutor.java:33)
at org.junit.platform.console.tasks.ConsoleTestExecutor.execute(ConsoleTestExecutor.java:57)
at org.junit.platform.console.ConsoleLauncher.executeTests(ConsoleLauncher.java:79)
at org.junit.platform.console.ConsoleLauncher.execute(ConsoleLauncher.java:69)
at org.junit.platform.console.ConsoleLauncher.main(ConsoleLauncher.java:41)
:junitPlatformTest FAILED
Does anyone knows how can I solve or work around this problem in order to make the build process works properly?jk
05/12/2017, 8:00 PMjackmiras
05/12/2017, 10:42 PMcarlw
05/13/2017, 12:41 PMrobfletcher
05/13/2017, 3:06 PMSubjectSpek
is pretty broken right now. When the spec is re-used with itBehavesLike
the tests themselves use the subject from the original so while it looks like things are working, it’s actually testing the wrong class! Also on
and it
get different instances when using the subject
property so tests can only be very simplistic. Is this known and still under development or should I file an issue on GitHub?robfletcher
05/13/2017, 3:06 PMobject JavaQueueSpec : SubjectSpek<Queue<String>>({
subject { LinkedList() }
describe("whatever") {
on("pushing an item") {
println("subject is a ${subject.javaClass} ${System.identityHashCode(subject)}")
subject.offer("Hi")
}
it("can get popped") {
println("subject is a ${subject.javaClass} ${System.identityHashCode(subject)}")
subject.poll() shouldEqual "Hi"
subject.poll() shouldEqual null
}
}
})
object ArrayDequeSpec : SubjectSpek<ArrayDeque<String>>({
subject { ArrayDeque() }
itBehavesLike(JavaQueueSpec)
})
robfletcher
05/13/2017, 3:07 PMSystem.identityHashCode
reported in on
and it
are different (although consistent if invoked multiple times in that context). Also ArrayDequeSpec
reports that its subject is actually a LinkedList
robfletcher
05/13/2017, 3:09 PMArrayDequeSpec
to have subject { throw IllegalStateException() }
it still runs “successfully”robfletcher
05/13/2017, 3:11 PMSpek
but it’s not easy to add additional tests in the sub-classes for any non-shared behavior.raniejade
05/13/2017, 4:14 PMtestRuntime 'org.jetbrains.spek:spek-junit-platform-engine'
raniejade
05/13/2017, 4:15 PMraniejade
05/13/2017, 4:20 PMsubject(CachingMode.GROUP) { ... }
raniejade
05/13/2017, 4:20 PMit
, on
) will have a unique instancerobfletcher
05/13/2017, 4:24 PMrobfletcher
05/13/2017, 4:25 PMitBehavesLike
using the wrong subject?raniejade
05/13/2017, 4:27 PMrobfletcher
05/13/2017, 4:29 PMcarlw
05/13/2017, 4:35 PMraniejade
05/13/2017, 4:43 PMrobfletcher
05/13/2017, 4:45 PMCachingMode.GROUP
works perfectly, thanks.