https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
spek
  • a

    artem_zin

    02/25/2017, 10:42 PM
    @sboishtyan I would suggest to start with separate
    on(”true”) { it(”does c”) {} } on(”false”) { it(”does d”) {}
    and once you feel comfortable with that — use more complicated things and reduce boilerplate, you’ll naturally find solutions that’ll fit your coding style since Spek tests are just kotlin code in a giant lambda expression
    s
    • 2
    • 4
  • j

    jackmiras

    03/27/2017, 5:50 PM
    Do you guys know how can I solve this problem?
    h
    a
    • 3
    • 13
  • c

    codeslubber

    04/08/2017, 3:14 AM
    it’s probably a known issue that when you run parts of a spec (click the green arrow next to a describe, e.g.), it still runs other parts of the test.. ?
    h
    m
    r
    • 4
    • 11
  • p

    pablisco

    04/09/2017, 5:07 PM
    Does anybody have issues with InteliJ (Android Studio)? The tests I make are not updated when running after a change to them 😞
    a
    r
    +2
    • 5
    • 7
  • s

    snowe

    04/20/2017, 11:44 PM
    what is really weird is that I don't have any issues running it with maven through the command line, but I think that's because it's actually not running. I can't get surefire to actually run the test.
    h
    r
    • 3
    • 15
  • s

    snowe

    04/26/2017, 2:37 PM
    I have three projects I'm attempting to get it working with. Two I found on github, one of those two is able to run in both intellij and maven, but it's source and test sources are both in src/main/kotlin and src/test/kotlin, so I found a different project where it's more along the lines of what I have, where the src is in src/main/java and the tests are in src/test/java and the src is java and the tests are kotlin. I was able to modify that to get it working, but attempting to do the same with our company project (which has multiple levels of parent poms and plugin management) has not been successful.
    h
    • 2
    • 8
  • c

    codeslubber

    04/27/2017, 2:50 PM
    not a Spek complaint but doesn’t it seem insane that build is still a single file that has to have a bunch of configs for each thing that is needed?? maybe time for a refactor like the one Tomcat did: instead of one file, let each tool install some little config stub in a directory then the tool loads them all…
    r
    h
    • 3
    • 8
  • v

    verachadw

    04/29/2017, 7:19 AM
    Hi, I just want to ask when is the next release for Spek. I found the problem on this https://github.com/JetBrains/spek/issues/195 and I saw it was already fixed in master. Do Spek have the snapshot version or something?
    h
    • 2
    • 3
  • j

    jackmiras

    05/15/2017, 5:26 PM
    @jk I've tried apply the changes suggested at this issue but nothing happen, the only thing the solves the problem is to do a downgrade the version of junit plugin from M4 to M3.
    j
    r
    • 3
    • 13
  • j

    jackmiras

    05/17/2017, 7:06 PM
    @jk Nothing change
    j
    r
    • 3
    • 10
  • r

    raniejade

    05/21/2017, 12:16 PM
    @robfletcher can you give an example?
    r
    • 2
    • 25
  • r

    robfletcher

    05/25/2017, 6:07 PM
    Are we going to get a Spek option for IntelliJ’s create test wizard?
    h
    • 2
    • 4
  • w

    wst

    06/07/2017, 11:17 PM
    So what should you do when having a mocks with different behavior? Create a spek for each case?
    r
    • 2
    • 1
  • p

    pniederw

    06/18/2017, 5:40 AM
    @aalmiray doesn’t look like rules are supported in spek?
    a
    • 2
    • 1
  • w

    witoldsz

    06/26/2017, 12:34 PM
    Hello, I have an issue with Spek. It looks like it does share objects between tests within a file. In Java I was using JUnit and each test recreates everything, so there are no issues with some dirty state from test X leaking to test Y. Am I doing something wrong?
    r
    j
    • 3
    • 35
  • j

    jackmiras

    06/27/2017, 1:52 AM
    @raniejade this android-junit5 repository apparently works but I'm still getting a error called:
    Error:Gradle: Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
    > Job failed, see logs for details
    r
    • 2
    • 5
  • i

    Ian

    07/06/2017, 2:52 AM
    Anyone have any ideas?
    r
    • 2
    • 5
  • d

    dsgryazin

    07/19/2017, 8:49 PM
    Please, anyone, share gists or repos with reallife spek tests? Need more examples for investigation. Android projects preffered
    r
    • 2
    • 3
  • a

    artur.dryomov

    07/21/2017, 4:23 AM
    @dsgryazin I gave a talk just recently with a special Spek section —
    <https://speakerdeck.com/arturdryomov/kotlin-max-payne-bkug-july-2017>
    . It will not answer all your questions, but projects Artem listed are great examples similar to what we do. Internally we use JUnit 4 runner on a JUnit 5 platform
    1.0.0-M4
    , mostly because IJ reliably supports only JUnit 4 across all its versions.
    M5
    broke our tests in a way, so yeah.
    👍 2
    h
    • 2
    • 1
  • i

    igor.wojda

    08/01/2017, 12:14 PM
    Hey I have been playing with
    Spek
    and I can't run them for Android project.
    Spek
    seems to have general problem with JUnit4 runner, so I am not sure how can I use it for Android project? Here is my sample project https://github.com/igorwojda/migrate-java-tests-to-kotlin I would be grateful if some one would take a look and give some fix hints or share working Spek on Android project
    a
    r
    j
    • 4
    • 31
  • b

    brainail

    08/09/2017, 9:01 PM
    With the same configuration everything works in AS 2.3.+ So maybe it's because of new gradle version ...
    r
    • 2
    • 1
  • j

    jk

    08/18/2017, 8:11 PM
    sounds like this issue: https://github.com/JetBrains/spek/issues/248#issuecomment-323049464 - I linked directly to the workaround
    r
    • 2
    • 1
  • p

    patjackson52

    08/24/2017, 1:35 PM
    Hi all! Recently used Spek in a port of the official Actions on Google SDK (Node.js) to kotlin. It worked great porting mocha & chai tests. I could literally copy and paste the JS, find and replace a few things and have a good place to start. Thank you Jetbrains, and who ever writes/maintains Spek. https://medium.com/ticketmaster-mobile-studio/introducing-actions-on-google-sdk-for-koltlin-java-89330f69be8f
    👍 1
    j
    h
    • 3
    • 3
  • w

    whitney

    08/30/2017, 3:23 PM
    Hi. I'm new to Spek. Trying to get my first tests to run. I'm having trouble with the "given, on, it" style. My tests don't run. If I leave out the "on" then the test does run. Any thoughts on what I might be doing wrong?
    a
    r
    h
    • 4
    • 18
  • j

    jk

    09/07/2017, 12:46 PM
    @raniejade the version numbers on http://spekframework.org/docs/latest/ are still showing 1.1.2 (and the older version of junit-platform)
    r
    • 2
    • 2
  • a

    aaronfox

    09/15/2017, 3:08 PM
    That didn't work either, command line or otherwise
    r
    • 2
    • 1
  • d

    dave08

    09/18/2017, 5:36 PM
    Any workaround? We should maybe open an issue?
    r
    • 2
    • 1
  • r

    reline

    09/22/2017, 7:33 PM
    I'm on kotlin 1.1.4-3
    e
    • 2
    • 1
  • w

    whitney

    09/22/2017, 7:37 PM
    I noticed that version 1.1.5 is available now; however, it does not seem to be up on Maven Central. Are you planning to upload it there?
    e
    r
    • 3
    • 5
  • c

    codeslubber

    09/25/2017, 3:09 AM
    Trying to add Spek to an Android project.. I wish I could get all the time back I have spent in the past few years diddling around with these insane build files.. will it ever be possible to create a project and get some tests running in less than a few hours??
    😆 1
    r
    t
    +2
    • 5
    • 191
Powered by Linen
Title
c

codeslubber

09/25/2017, 3:09 AM
Trying to add Spek to an Android project.. I wish I could get all the time back I have spent in the past few years diddling around with these insane build files.. will it ever be possible to create a project and get some tests running in less than a few hours??
😆 1
r

raniejade

09/25/2017, 3:15 AM
Yep there is and it’s planned for 2.x. We will provide our own gradle plugin (which will use JUnit 5 under the hood) for jvm and android projects.
c

codeslubber

09/25/2017, 3:19 AM
Hate to whine about this but OMG I am so burned out on this thing.. I got it all to build the tests, but when I go to run it (inside AS3) it says that it cannot find the tests:
how can I paste an image into a thread??
r

raniejade

09/25/2017, 3:21 AM
So sorry about that. What version are you using? You might be experiencing this issue: https://github.com/JetBrains/spek/issues/248
c

codeslubber

09/25/2017, 3:21 AM
WARNING: TestEngine with ID ‘spek’ failed to discover tests
is the message
yeah I looked at that thread
seriously a link to that should be in the first paragraph of the docs
like the sign in the inferno: ‘those who enter here…’
I mean I see a lot of bonfires, but that thread is super insane.. bleak
I couldn’t even follow it after a while
that’s from a while ago
I am using AS3B6
I added dependencies with the filtering
r

raniejade

09/25/2017, 3:24 AM
if you can paste the build I can take a look.
c

codeslubber

09/25/2017, 3:25 AM
if you want I could add you to the repo
it’s on github
?
r

raniejade

09/25/2017, 3:25 AM
sure
c

codeslubber

09/25/2017, 3:28 AM
ok added you
thanks Ranie!
I bet you will figure it out in minutes.. sorry, I have used Spek a lot of times before and have never seen this problem…
usually if the tests compile they run
(but have not used it in Android…)
r

raniejade

09/25/2017, 3:30 AM
Looking into it now.
I don’t see anything spek related in master?
c

codeslubber

09/25/2017, 3:33 AM
oh wait!!
sorry about that !!
ok it’s there
@raniejade did you get it to build?
r

raniejade

09/25/2017, 3:38 AM
yep, testing out a fix. Looks like we need to update the docs. JUnit 5 gradle plugin doesn’t like android projects.
I’ll try it out with this https://github.com/mannodermaus/android-junit5
c

codeslubber

09/25/2017, 3:40 AM
ok sure
changing to junit 5 is fine
I created the project with the basic AS3 template
the junit tests don’t run anymore either..
r

raniejade

09/25/2017, 4:02 AM
do you need it running as well?
c

codeslubber

09/25/2017, 4:03 AM
no
just if I cannot get Spek to work
will have to use JUnit
I am putting together a Kotlin intro course
to convince a team that’s using J to use K
I think if we got into the setup and dropped into this smoking hole it would have been a short argument…
r

raniejade

09/25/2017, 4:04 AM
sure 🙂
looks like it’s more of kotlin - android issue https://issuetracker.google.com/issues/64804587
c

codeslubber

09/25/2017, 4:25 AM
uh oh
r

raniejade

09/25/2017, 4:26 AM
pretty sure this was fixed in the canary builds
c

codeslubber

09/25/2017, 4:26 AM
so should I just abandon all hope of getting this to work?
canary builds of Kotlin?
r

raniejade

09/25/2017, 4:26 AM
android
c

codeslubber

09/25/2017, 4:26 AM
AS3 is canary isn’t it using canary K?
oh
r

raniejade

09/25/2017, 4:27 AM
trying out the canary builds
c

codeslubber

09/25/2017, 4:27 AM
great
so basically the kotlin files are not getting copied during the build of the test target? wow…
r

raniejade

09/25/2017, 4:33 AM
yeah 😞
I finally made it work
c

codeslubber

09/25/2017, 4:47 AM
no way!!
how?
r

raniejade

09/25/2017, 4:48 AM
I’ll create a PR.
c

codeslubber

09/25/2017, 4:48 AM
fantastic!!
r

raniejade

09/25/2017, 4:49 AM
I would blame gradle 4 for this. hahaha
To make jUnit 4 work again, just add JUnit5's vintage engine to the test classpath
Let me know if it works for you 🙂
c

codeslubber

09/25/2017, 4:53 AM
just pulled
I think I have your changes
getting the same thing
lemme double check but the build was a very long one so it was doing something new
r

raniejade

09/25/2017, 4:53 AM
can you run clean?
c

codeslubber

09/25/2017, 4:54 AM
tried that then reran tests again
?
lemme try close/open
r

raniejade

09/25/2017, 4:54 AM
./gradlew clean test
ahh
wait your running it from AS right?
c

codeslubber

09/25/2017, 4:55 AM
yes
oh crap
😞 same thing I just want to jump out the window
r

raniejade

09/25/2017, 4:56 AM
you might need to add a before run task for your run configuration
c

codeslubber

09/25/2017, 4:56 AM
that’s 3 hours gone that could have gone into building something
r

raniejade

09/25/2017, 4:56 AM
wait let me try something
c

codeslubber

09/25/2017, 4:56 AM
did you do that?
will I have to do that for each test?
yeah there was a Run Configuration already of course
r

raniejade

09/25/2017, 4:57 AM
can you add this in the root build.gradle
subprojects { subProject ->
    afterEvaluate {
        if (subProject.plugins.hasPlugin("kotlin") && subProject.plugins.hasPlugin("java-library")) {
            subProject.kotlin.copyClassesToJavaOutput = true
            subProject.jar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
        }
    }
}
then resync the project, delete any existing run configurations
c

codeslubber

09/25/2017, 4:58 AM
dump that in the bottom?
r

raniejade

09/25/2017, 4:58 AM
yep
c

codeslubber

09/25/2017, 4:59 AM
after allProjects {}
?
r

raniejade

09/25/2017, 4:59 AM
yes
c

codeslubber

09/25/2017, 4:59 AM
got it
r

raniejade

09/25/2017, 4:59 AM
the initial PR was fixing the issue when running the tests via cmd line
c

codeslubber

09/25/2017, 5:00 AM
WARNING: TestEngine with ID ‘spek’ failed to discover tests org.junit.platform.commons.util.PreconditionViolationException: Could not load class with name: com.tvcoursework.kotlinintrocourse.CurrencyTest at org.junit.platform.engine.discovery.ClassSelector.lambda$getJavaClass$0(ClassSelector.java:71)
yeah command line tests are a joke
r

raniejade

09/25/2017, 5:00 AM
ughhh
wait
c

codeslubber

09/25/2017, 5:00 AM
Xcode was just rewritten completely and the tests just work and are blazingly fast
these guys all have ios and android teams so.. don’t think I can tell them to go back to the CLI… 🙂
ok waiting.. ?
r

raniejade

09/25/2017, 5:02 AM
can you add this dependency testImplementation org.junit.platform:junit-platform-runner:1.0.0
are you using the Spek plugin?
c

codeslubber

09/25/2017, 5:04 AM
yes
I have it installed
r

raniejade

09/25/2017, 5:04 AM
latest version?
c

codeslubber

09/25/2017, 5:05 AM
just installed tonight?
but wait
maybe I installed the last stable one
which one should I get?
r

raniejade

09/25/2017, 5:05 AM
v0.4.3
should be the latest
c

codeslubber

09/25/2017, 5:06 AM
yeah that’s what I have
ok so still same message ?
r

raniejade

09/25/2017, 5:06 AM
ughhhh
c

codeslubber

09/25/2017, 5:06 AM
after adding the last dependency..
should I delete the Run Config?
r

raniejade

09/25/2017, 5:06 AM
yep please
c

codeslubber

09/25/2017, 5:07 AM
nope same thing
r

raniejade

09/25/2017, 5:07 AM
hmmm
last
c

codeslubber

09/25/2017, 5:07 AM
OMG seriously I don’t even remember what I wanted to build with these tools anymore.. I remember I was excited about it.. a while ago.. 😞
last?
r

raniejade

09/25/2017, 5:08 AM
going to downgrade to RC2
c

codeslubber

09/25/2017, 5:08 AM
OMG who thought this stuff was ready to be used.. for all the hype K is getting right now, this is utter madness…
r

raniejade

09/25/2017, 5:11 AM
push something into master
can you pull and reimport?
don’t have AS 3.0 here, downloading it but it’s slow 😞
c

codeslubber

09/25/2017, 5:12 AM
oh no.. wow
r

raniejade

09/25/2017, 5:13 AM
I have a copy at home, I can check this later
c

codeslubber

09/25/2017, 5:13 AM
ok thanks I guess I will give up for tonight
feel like a whipped dog
r

raniejade

09/25/2017, 5:13 AM
I’m pretty sure I got a working android project at home using AS 3.0
c

codeslubber

09/25/2017, 5:13 AM
this thing should have cones up around it
great
as I said
r

raniejade

09/25/2017, 5:14 AM
I’ll let you know
c

codeslubber

09/25/2017, 5:14 AM
I did a brand new project
all I did was attempt to add Spek
you have access to the repo
hell I will make a donation to your Patreon page (if you have one) if/when this gets working
I don’t have tons more time to vaporize into this hole, have to prep other stuff… 😧
r

raniejade

09/25/2017, 5:15 AM
No worries, I’ll update you once things are working 🙂
c

codeslubber

09/25/2017, 5:16 AM
I am still kind of confused about whether AS3 is required to show Kotlin on O?
should I just use 2.3.3?
r

raniejade

09/25/2017, 5:17 AM
I don’t have any idea, not an android dev 🙂
c

codeslubber

09/25/2017, 5:17 AM
why cannot I paste a bloody image into a thread???
alright thanks Ranie
really appreciate your efforts
r

raniejade

09/25/2017, 5:18 AM
no worries 🙂
c

codeslubber

09/25/2017, 5:18 AM
if you can make it work, will you send another MR?
r

raniejade

09/25/2017, 5:19 AM
yes
c

codeslubber

09/25/2017, 5:19 AM
great thanks.. !
r

raniejade

09/25/2017, 5:47 AM
got it working (again) lol
but now it’s running in AS
PR sent 🙂
c

codeslubber

09/25/2017, 2:05 PM
dude you da man!! great job!
OMG you will not believe this @raniejade it stopped working again and is spitting up errors.. completely insane..
I pushed you could take a look if you want, I think I am done with Spek, probably forever.. gonna try and just use JUnit….
r

raniejade

09/26/2017, 12:19 AM
I think you still have the same problem when using JUnit. Real issue is that classes compiled by kotlin are copied over to the directory AS expects.
c

codeslubber

09/26/2017, 1:07 AM
so far junit is working
r

raniejade

09/26/2017, 1:08 AM
Interesting, hmmm. I'll take a look again.
c

codeslubber

09/26/2017, 1:15 AM
appreciate your efforts
frankly the vanilla project does junit 4.x
but has hamcrest which is actually ok
r

raniejade

09/26/2017, 1:20 AM
My problem with AS they have a lot of hardcoded stuff for specific test frameworks. In fact the spek idea plugin, takes advantage of that. Tricked AS to treat spek as Specs2.
c

codeslubber

09/26/2017, 1:32 AM
weird
r

raniejade

09/26/2017, 2:40 AM
sent another PR. This really annoying, kotlin and android integration really sucks in 3.0.
Pretty sure this was working w/ 3.0 Canary, was working with spek plugin at that time. https://issuetracker.google.com/issues/64804587
c

codeslubber

09/26/2017, 2:43 AM
wow ok will try it
thanks again
you would think they would be taking K more seriously amidst all the hype
r

raniejade

09/26/2017, 2:46 AM
True, I think the problem is there is no or little coordination between the android and kotlin team.
t

timrijckaert

09/26/2017, 8:05 AM
btw https://github.com/JetBrains/spek/issues/256
seems like we are in the same boat
r

raniejade

09/26/2017, 8:06 AM
Ahh, shit. Sorry totally forgot about that ticket. I think I may have a fix.
@timrijckaert let me reply on the ticket.
t

timrijckaert

09/26/2017, 10:56 PM
Is the repo from @codeslubber somewhere public so I can check the config that is needed to get Spek to run in AS3?
c

codeslubber

09/26/2017, 11:02 PM
@timrijckaert it is not public but happy to send you the gradle files, that’s all you need to see right?
t

timrijckaert

09/26/2017, 11:02 PM
yes
or you could show them to the world and help everybody https://github.com/JetBrains/spek/issues/256
m

mmaillot

09/27/2017, 1:16 PM
I very interesting to see the gradle too 🙂
r

raniejade

09/27/2017, 1:45 PM
@mmaillot check the ticket 🙂
m

mmaillot

09/27/2017, 1:46 PM
Thanks you ! 🙂
t

timrijckaert

09/27/2017, 2:34 PM
Nice this seems to resolve my issues thanks @raniejade & @codeslubber
c

codeslubber

09/27/2017, 2:35 PM
Good to hear @timrijckaert
t

timrijckaert

09/27/2017, 2:38 PM
Maybe a good idea to update the docs to reflect a better guide on how to setup Spek with Android
c

codeslubber

09/27/2017, 2:43 PM
That was one of the first things @raniejade said. To me one of the biggest problems in tech is that cones are not put up around open man holes so people fall in all the time. Probably in the future, there will be bots that will continuously estimate the likelihood that a chosen toe path will get you where you want to go without falling off a cliff..
r

raniejade

09/27/2017, 3:52 PM
https://github.com/JetBrains/spek/pull/271
I don't know why this hasn't been fixed yet, but it's kinda annoying that you have to tell android where the kotlin sources are.
sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
        test.java.srcDirs += 'src/test/kotlin'
    }
➕ 1
m

mannodermaus

09/27/2017, 10:38 PM
For me, the proposed code snippet doesn’t run directly from AS (
ClassNotFound
on
JUnit5IdeaTestRunner
) unless I also explicitly add the
android-junit5-embedded-runtime
artifact from the plugin’s repo. I’ll amend the issue with that, just in case somebody else stumbles upon it
Also, the android-junit5 aren’t setup completely in there. I’ll do some clean-up and remove the unnecessary stuff before we can attach it to spek’s docs!
t

timrijckaert

09/28/2017, 9:02 AM
Nice work it makes more sense now. I'm not at home with all this configuration work. I just wanna write a Spek test. Thanks for the steps in the issue. Maybe @raniejadecan add this to his PR
View count: 3