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
  • d

    dave08

    09/27/2017, 10:53 AM
    Is there any way to mock a extension function with Mockito?
    t
    • 2
    • 7
  • d

    dave08

    09/28/2017, 1:40 PM
    The send is being called by my SUT and the test is on the return of the function calling send in the SUT.
    k
    • 2
    • 5
  • a

    artur.dryomov

    09/28/2017, 5:06 PM
    I believe it is not Spek-related discussion anymore.
    a
    d
    • 3
    • 4
  • a

    artem_zin

    09/29/2017, 7:44 PM
    should work, please make sure everything JUnit platform related is on 1.0.0 and JUnit Jupiter related is on
    5.0.0
    . Also you can try to kill/start Gradle daemon just in case
    j
    z
    t
    • 4
    • 20
  • c

    codeslubber

    10/06/2017, 2:12 AM
    hey @raniejade beta 7 dropped today, do you think the file copy in test builds bug is fixed?
    r
    • 2
    • 3
  • h

    harshitbangar

    10/11/2017, 10:09 AM
    i need it for robolectric
    r
    • 2
    • 9
  • b

    bdawg.io

    10/11/2017, 11:22 PM
    I’ll probably just use JUnit 5 alone. I’ve had this debugging issue for about a week now (ever since i’ve tried to start using it) and have yet to have successful output with the intellij plugin. It’s a cool library otherwise
    r
    • 2
    • 2
  • h

    harshitbangar

    10/12/2017, 1:03 PM
    can you check the code?
    r
    • 2
    • 18
  • p

    pardom

    10/12/2017, 4:34 PM
    Oh, do I need to target Java 8?
    • 1
    • 1
  • p

    pardom

    10/12/2017, 4:39 PM
    nvm... apparently Spek with Android doesn't support JUnit 5
    t
    • 2
    • 1
  • s

    snowe

    10/12/2017, 8:08 PM
    does anyone have any examples of spek in a MASSIVE project? I'm just wondering how well spek converts from small open-source projects to a project with hundreds of thousands of lines of code.
    a
    a
    • 3
    • 8
  • h

    harshitbangar

    10/16/2017, 7:05 AM
    https://github.com/spekframework/spek/issues/286 - still issues with multiple class loaders. i added an example how is this working in java 8 and junit 4 based specification framework. please check whenever you are free.
    r
    • 2
    • 9
  • d

    dave08

    10/16/2017, 8:19 AM
    Isn't it enough to just reset it with the factory in afterEachGroup? I'm just trying to understand the implementation to know what to expect...
    r
    • 2
    • 2
  • m

    mkporwit

    10/16/2017, 8:24 AM
    But unlike the stock JUnit-based setup, makeRedisHandler in the Spek instance fails because it claims it cannot get the container IP or port until the container is started.
    r
    • 2
    • 59
  • c

    codeslubber

    10/22/2017, 3:50 PM
    @raniejade anything? does spek work with the AS3 RC?
    r
    • 2
    • 1
  • m

    mkporwit

    10/24/2017, 6:20 PM
    Are there limitations around using annotations for Spek test classes? I'm trying to leverage
    com.github.trevershick.test.ldap
    , which can take an annotation to additionally configure the LDAP instance. This annotation works fine in JUnit (4 and 5) based tests, but appears to break with Spek.
    @LdapConfiguration(ldifs = arrayOf(Ldif("/hoyluPersonTestSchema.ldif")))
    class LdapHandlerSpec : Spek({
        val ldapServer = LdapServerResource(this)
    r
    • 2
    • 14
  • s

    sngrekov

    10/28/2017, 8:21 AM
    @codeslubber if you are interested, I managed to run Paulina's sample on AGP 3.0 https://github.com/sgrekov/hangman/commit/724040abd9b73cc9cd56d44f19efe77ed24317e4
    👍 2
    r
    • 2
    • 2
  • a

    adambl4

    11/01/2017, 1:13 PM
    This doc doesn’t work https://github.com/spekframework/spek/blob/e659eb633928f74cc52480e734ab6155dc310656/documentation/src/asciidoc/setting-up.adoc#setting-up-android
    r
    • 2
    • 12
  • a

    ayrat555

    11/03/2017, 8:24 PM
    where should I look?
    r
    • 2
    • 1
  • p

    poohbar

    11/06/2017, 1:57 AM
    I get:
    WARNING: TestEngine with ID 'spek' failed to discover tests
    r
    • 2
    • 1
  • p

    poohbar

    11/06/2017, 12:21 PM
    stacktrace:
    Nov 06, 2017 7:19:28 AM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
    WARNING: TestEngine with ID 'spek' failed to discover tests
    java.lang.IllegalAccessError: tried to access method org.junit.platform.engine.support.descriptor.ClassSource.<init>(Ljava/lang/Class;)V from class org.jetbrains.spek.engine.SpekTestEngine
    	at org.jetbrains.spek.engine.SpekTestEngine.resolveSpec(SpekTestEngine.kt:114)
    	at org.jetbrains.spek.engine.SpekTestEngine.resolveSpecs(SpekTestEngine.kt:80)
    	at org.jetbrains.spek.engine.SpekTestEngine.discover(SpekTestEngine.kt:50)
    	at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:130)
    	at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:117)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
    	at org.jetbrains.spek.tooling.runner.junit.JUnitPlatformSpekRunner.run(JUnitPlatformSpekRunner.kt:107)
    	at org.jetbrains.spek.tooling.MainKt.main(Main.kt:58
    pom.xml
    <dependencies>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jre8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-core_2.11</artifactId>
                <version>2.2.0</version>
            </dependency>
            <dependency>
                <groupId>com.github.jkcclemens</groupId>
                <artifactId>khttp</artifactId>
                <version>master-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>org.knowm.xchart</groupId>
                <artifactId>xchart</artifactId>
                <version>3.5.0</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.spek</groupId>
                <artifactId>spek-api</artifactId>
                <version>1.1.5</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.spek</groupId>
                <artifactId>spek-junit-platform-engine</artifactId>
                <version>1.1.5</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.amshove.kluent</groupId>
                <artifactId>kluent</artifactId>
                <version>1.30</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-runner</artifactId>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
        </dependencies>
    My test is in
    src/test/kotlin
    object Test: Spek({
        describe("a calculator") {
    
            it("should return the result of adding the first number to the second number") {
                "test" shouldEqual "test"
            }
    
            it("should return the result of subtracting the second number from the first number") {
            }
        }
    })
    r
    • 2
    • 13
  • j

    jackmiras

    11/07/2017, 12:47 PM
    Hey guys, the problem that was happening with AndroidStudio3.0 is still happening?
    s
    r
    c
    • 4
    • 30
  • a

    artem_zin

    11/14/2017, 10:33 PM
    why do you want that? The only valid answer is: "action is too expensive" :troll:
    r
    • 2
    • 2
  • h

    harshitbangar

    11/21/2017, 1:46 AM
    Junit 5 fixed a few of those issues (such as description, nested classes, extensions). Unfortunately it will take forever to become a standard. The session was really insightful.
    d
    • 2
    • 2
  • d

    dsgryazin

    11/21/2017, 11:17 AM
    @artem_zin I have a question for you that intrigues me the most Have you tried
    kotlin-test
    ? The argument "spek was hold on jetbrains repo" sounds weak. Very interested if you have any experience with it. I personally consider kotlin-test as the main alternative to spek/spock/etc. And to writing own testing lib, of course 😂
    a
    • 2
    • 3
  • k

    kasper.kondzielski

    11/21/2017, 11:23 AM
    @dsgryazin If I may join 😉 I’ve tried and it was cool but it wasn’t sufficient because it didn’t allow to have unlimited nesting of test cases. On the other hand it was very easy to write custom Specification which does based on its based specification class. (But it performed poorly)
    d
    • 2
    • 7
  • v

    voddan

    12/03/2017, 12:03 PM
    Hi! I would like to use Spek as a drop-in replacement for JUnit, but the configuration instructions that I've found insist on replacing the test runner. Is there a way to run spek without its runner?
    r
    • 2
    • 4
  • v

    voddan

    12/03/2017, 3:08 PM
    One small detail I can't get to be perfect yet:
    on("1122") {
        val input = "1122"
        val result = taskA(input)
    
        it("should produce 3") {
            assertEquals(3, result)
        }
    }
    As you see, there are unfortunate repetitions of the input value and the assert value if I want to use them in the section names. How do you tackle that?
    t
    • 2
    • 7
  • c

    codeslubber

    12/12/2017, 3:35 AM
    @raniejade is this the same bug? https://stackoverflow.com/questions/45819700/android-studio-3-0-gradle-3-0-0-beta2-breaks-kotlin-unit-test-coverage
    r
    • 2
    • 8
  • o

    orangy

    02/02/2018, 10:07 AM
    We are prototyping a special DSL highlighting that hides the “syntax” highlighting and provides an option to have a custom highlighting on a DSL. What would be Spek functions to consider a top level DSL to highlight? We’d like to experiment with it. /cc @pavel.talanov
    😱 2
    👍 2
    g
    r
    • 3
    • 10
Powered by Linen
Title
o

orangy

02/02/2018, 10:07 AM
We are prototyping a special DSL highlighting that hides the “syntax” highlighting and provides an option to have a custom highlighting on a DSL. What would be Spek functions to consider a top level DSL to highlight? We’d like to experiment with it. /cc @pavel.talanov
😱 2
👍 2
g

gildor

02/02/2018, 10:10 AM
It’s really cool feature. Do you consider to experiment with #gradle kotlin-dsl? I think it will be really helpful there, because now too many extensions function there, so highlighting looks not very good
👍 1
describe
is usua.lly top level function for Spek. But
describe
also can be nested
o

orangy

02/02/2018, 3:54 PM
Gradle of course, also kotlinx.html, ktor, etc. These we have on the radar, but I’m not currently tracking Spek progress.
You don’t use any fancy stuff, just normal builder-style functions with extension lambdas?
g

gildor

02/03/2018, 1:50 PM
Yes, just functions of Spek class + extensions
o

orangy

02/03/2018, 2:52 PM
Are you using DslMarker for DSLs?
g

gildor

02/03/2018, 2:58 PM
I’m not a Spek contributor, but there is no DslMarkers, but it’s definitely should be added to Spek, for example to prevent actions nesting
👍 1
r

raniejade

02/06/2018, 5:09 AM
@orangy yes, we are adding DslMarkers for 2.x.
Can you give a more visual example? Not sure if I quite understand what you are trying to do.
o

orangy

02/07/2018, 2:13 PM
I can do it later this or next week
💯 1
View count: 1