Nikky
12/21/2018, 10:21 AMpiclem
12/21/2018, 7:58 PMjohannes.lagos
12/27/2018, 10:49 AMSergio Crespo Toubes
12/28/2018, 4:09 PMmmaillot
01/10/2019, 1:01 PMobject SplashScreenPresenterTest: Spek({
describe("SplashScreen presenter") {
lateinit var viewMock: SplashScreenView
describe("on no migration running") {
val loadApplicationStateMock = mock<LoadApplicationState> {
onBlocking { invoke(any()) } doReturn ApplicationState.MIGRATION_CLASSIC
}
val splashScreenPresenter = SplashScreenPresenter(viewMock, loadApplicationStateMock)
it("should route to standard welcome screen") {
runBlocking {
splashScreenPresenter.loadState()
verify(viewMock, times(1)).moveToClassicMigrationScreen()
}
}
}
}
I want to use viewMock in multiple describe. I use verify, so I need to reset the mock for each describe. How can I init my viewMock for each describe?dzaitsev
01/11/2019, 9:40 AM@RunWith(JUnitPlatform::class)
but it requires us to change kotlin dependency from kotlin-stdlib-jdk7
to kotlin-stdlib-jdk8
because it needs streams.
Any advice?
spek 2.0.0-rc.1, kotlin 1.3.11, AS 3.4 Canary 10, Gradle 5.1snowe
01/15/2019, 12:38 AMmmaillot
01/16/2019, 9:25 AMNothing here
message. I can run my test with gradle.mmaillot
01/18/2019, 1:18 PMRun 'Spek tests in....'
, I got an error: Test framework quit unexpectedly
without more informationcharleskorn
01/20/2019, 10:10 PMmp
01/29/2019, 9:55 AMsnowe
01/29/2019, 4:28 PMsnowe
01/31/2019, 1:50 AMsnowe
02/01/2019, 5:44 AMpitest
with spek?
I get 10:42:19 PM PIT >> INFO : Sending 86 test classes to minion
10:42:19 PM PIT >> INFO : Sent tests to minion
10:42:20 PM PIT >> INFO : MINION : 10:42:20 PM PIT >> INFO : Checking environment
10:42:20 PM PIT >> INFO : MINION : 10:42:20 PM PIT >> INFO : Found 0 tests
10:42:20 PM PIT >> INFO : MINION : 10:42:20 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0
10:42:20 PM PIT >> INFO : MINION : 10:42:20 PM PIT >> INFO : 0 tests received
tapchicoma
02/01/2019, 1:13 PMraniejade
02/04/2019, 7:00 AMNikky
02/06/2019, 4:56 AMhttps://i.imgur.com/SkeXjL8.png▾
Feb 06, 2019 5:52:02 PM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
WARNING: TestEngine with ID 'spek2' failed to discover tests
java.lang.IllegalStateException: it.javaClass.`package` must not be null
at org.spekframework.spek2.junit.SpekTestEngine.discover(SpekTestEngine.kt:51)
at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:168)
at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:155)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
or maybe its not really related.. but the error seems to make no sensealilosoft
02/09/2019, 5:07 AMalilosoft
02/10/2019, 9:47 PMincludeEngines("spek2")
from my gradle build then all the tests run fine 👍
So my question: Is this behavior intended or is it a bug?
My second problem is related to MockK:alilosoft
02/10/2019, 10:06 PMalilosoft
02/10/2019, 10:32 PMchristophsturm
02/13/2019, 12:44 PMrook
02/15/2019, 7:08 PMNoClassDefFoundError
It looks like I’m missing a dependency or something?tapchicoma
02/18/2019, 9:54 AMSlackbot
02/21/2019, 8:28 PMpavel
02/21/2019, 8:57 PMScenario
instead?Shan
02/23/2019, 11:52 PMShan
03/05/2019, 7:19 AMraniejade
03/23/2019, 1:54 AMmemoized
on your tests? https://github.com/spekframework/spek/pull/660 came up to eagerly evaluate memoized
during the execution phase instead of evaluating on access. Options: :yes:, 🇳🇴 and 🙃 if you didn’t know that memoized
is lazy.svenjacobs
03/28/2019, 2:02 PMbeforeGroup
but with a greater scope?svenjacobs
03/28/2019, 2:02 PMbeforeGroup
but with a greater scope?raniejade
03/28/2019, 11:32 PMsvenjacobs
03/29/2019, 10:53 AMraniejade
04/02/2019, 8:26 AMbeforeGroup
inside desribe("Injection")
which will be only executed for that group.svenjacobs
04/02/2019, 8:41 AMraniejade
04/02/2019, 9:28 PMsvenjacobs
04/03/2019, 7:11 AMraniejade
04/03/2019, 9:29 PMbeforeGroup
just before the first describe. Just realised that I have a typo in my previous reply 😂 then having on the root scope is fine -> then having one on the root scope is fine
svenjacobs
04/04/2019, 9:49 AMbeforeGroup
is run as the first test when I run ./gradlew test
? Are they called in alphabetical order? So will A_Test.kt
run before B_Test.kt
? And what if an order is not guaranteed?raniejade
04/04/2019, 11:20 AMbeforeGroup
is not global and won’t affect other classes.
class A: Spek({
beforeGroup { ... }
})
class B: Spek({
beforeGroup { ... }
})
beforeGroup
on A
and B
are isolated.svenjacobs
04/04/2019, 11:27 AMraniejade
04/04/2019, 9:34 PM