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
strikt
  • r

    robfletcher

    05/16/2018, 6:27 PM
    @danny here’s a good issue for the Gradle expert! https://github.com/robfletcher/strikt/issues/22
    d
    • 2
    • 29
  • r

    raniejade

    05/17/2018, 3:39 AM
    @robfletcher will strikt support kotlin multiplatform or just the JVM?
    r
    • 2
    • 3
  • g

    gregopet

    05/17/2018, 5:56 AM
    I worked with some of your open source stuff and watched some of your talks, you could almost say you have a fan 😄
    r
    • 2
    • 2
  • r

    raniejade

    07/25/2018, 11:45 PM
    Just recently fixed the issue on java 10 for spek. You're using
    2.0.0-alpha.1
    right?
    r
    • 2
    • 1
  • r

    robfletcher

    08/22/2018, 4:33 PM
    ooh, interesting
    • 1
    • 1
  • c

    christophsturm

    09/06/2018, 11:17 AM
    how can i group 2 asserts that use a different subject?
    r
    • 2
    • 2
  • c

    christophsturm

    09/13/2018, 5:53 PM
    so i think when actual is null, isActualDefined needs to be false
    r
    • 2
    • 4
  • r

    robfletcher

    10/02/2018, 12:22 AM
    (obviously with a better name than
    f
    )
    c
    • 2
    • 22
  • r

    robfletcher

    10/07/2018, 12:19 AM
    Couple of issues: - it highlights test output in the snippets as though it was Kotlin code - the search doesn’t appear to work (not sure if that’s just locally but I see errors in the JavaScript console)
    c
    • 2
    • 2
  • c

    christophsturm

    10/09/2018, 2:39 PM
    is there a way to detect expectations that can never fail, like
    expectThat("blah").isA<String>()
    ?
    r
    • 2
    • 7
  • c

    Casey Brooks

    10/16/2018, 6:20 PM
    most of the time it is just a String, but I think the Nebula plugins set it as an actual object. But the Orchid gradle plugin expects it to be a String (which is a bug)
    d
    • 2
    • 1
  • r

    robfletcher

    10/24/2018, 5:06 PM
    I’m on a podcast hosted by a couple of friends of mine talking about Kotlin & Strikt https://soundcloud.com/funtimeexception/episode-210-it-just-wont-quit
    c
    • 2
    • 1
  • s

    sandjelkovic

    10/26/2018, 8:33 AM
    I created a PR with initial support for Sorted Assertion on the Collection. Feedback on the API and semantics is very welcome.
    r
    • 2
    • 1
  • r

    robfletcher

    11/06/2018, 5:22 AM
    Thanks. It shouldn’t require coroutines. Can you give me an example of what you’re running in to?
    a
    • 2
    • 3
  • m

    mkobit

    11/26/2018, 4:38 PM
    if want to write a custom assertions for something like
    Option<T>
    where it is either a
    Some
    or
    None
    type, what is the best way to rite those? for example, would it be better to have something like
    fun Assertion.Builder<Option<T>>.isSome(asserts: Assertion.Builder<T>.() -> Unit)
    or is there a better way to "chain" it where it short circuits the following assertions if it a
    None
    ?
    fun Assertion.Builder<Option<T>>.isSome(): Assertion.Builder<T>
    s
    • 2
    • 2
  • d

    dave08

    11/28/2018, 12:16 PM
    This doesn't seem to work...:
    inline fun <reified R> Assertion.Builder<Iterable<*>>.filterIsInstance(): DescribeableBuilder<List<R>> =
    		get { filterIsInstance<R>() }
    ?
    r
    • 2
    • 44
  • d

    dave08

    11/28/2018, 5:39 PM
    Another little point: running
    expectThat(catching { ... }).isNull()
    , if it throws, it doesn't print the exceptions message... in my case:
    ▼ Expect that com.squareup.moshi.JsonDataException:
      ✗ is null
    which doesn't help too much to identify the source of the problem.
    m
    • 2
    • 1
  • r

    robfletcher

    12/01/2018, 8:28 PM
    @Casey Brooks I tried upgrading to Orchid 0.14.0 but the when I do the
    orchidServe
    task the images all get 404s
    c
    • 2
    • 5
  • m

    mkobit

    12/03/2018, 4:22 PM
    im working on some additional assertions for
    File
    and
    Path
    that im hoping to open an MR to
    strikt
    with, and seeing a few patterns emerge that im hoping to get some early feedback before working through it too much. 1. for certain "getter" style evaluation, is it better to expose as a property or function?
    val <T : Path> Builder<T>.fileName: Builder<Path>
    versus
    fun <T : Path> Builder<T>.fileName(): Builder<Path>
    2. for "boolean" style testing, like "is this readable", what is the desired API to expose?
    val <T : Path> Builder<T>.isHidden: Builder<Boolean>
    or
    // assert(...)
    fun <T : Path> Builder<T>.isHidden(): Builder<T>
    fun <T : Path> Builder<T>.isNotHidden(): Builder<T>
    (this gets a bit more complicated with checks like
    exists
    because the underlying API accepting varargs of
    LinkOption
    ) 3. for assertion style things, is it best to offer multiple APIs for inversions and other possible for example:
    fun <T : Path> Builder<T>.startsWith(other: String): Builder<T>
    fun <T : Path> Builder<T>.doesNotStartWith(other: String): Builder<T>
    or is there an opportunity to add something for consumers like an
    doesNot { startsWith(other) }
    to reduce API surface?
    r
    • 2
    • 3
  • c

    christophsturm

    12/08/2018, 11:10 AM
    maybe in soft assertions the stacktrace for the specific failure should be for the line of the assertion and not for the line that contains the expect.
    r
    • 2
    • 7
  • c

    christophsturm

    12/12/2018, 7:10 PM
    does anyone have an idea how i can remove the duplication in this test: https://github.com/christophsturm/randolf/blob/b5c2eea6d5bd0da587220073ddb4496760b4e17a/src/test/kotlin/randolf/RandolfTest.kt#L84-L117
    d
    • 2
    • 9
  • c

    christophsturm

    02/18/2019, 3:12 PM
    theres way too many people who do not know that strikt is the best assertion lib
    d
    r
    x
    • 4
    • 6
  • r

    robfletcher

    04/17/2019, 5:29 PM
    @mkobit Just checked and
    strikt-gradle
    is in jcenter now
    m
    • 2
    • 1
  • r

    robfletcher

    05/15/2019, 7:15 PM
    definitely!
    👍 1
    a
    • 2
    • 2
  • s

    sandjelkovic

    05/16/2019, 8:13 AM
    Maybe you could also provide a way to do assertions in the wrapped value as well, not just a predicate?
    a
    • 2
    • 4
  • m

    mkobit

    05/16/2019, 6:49 PM
    i have an old assertj assertion that uses conditions that is
    val hpi = condition<String>(".hpi extension") { it.endsWith("@hpi") }
          val jpi = condition<String>(".jpi extension") { it.endsWith("@jpi") }
          val war = condition<String>(".war extension") { it.endsWith("@war") }
          val jenkinsWar = condition<String>("Jenkins WAR group and module") { it.contains("org.jenkins-ci.main:jenkins-war") }
          assertThat(line)
            .has(anyOf(allOf(war, jenkinsWar), hpi, jpi))
    where
    condition
    is a helper to create https://joel-costigliola.github.io/assertj/core-8/api/org/assertj/core/api/Condition.html is there anything comparable in
    strikt
    yet to accomplish the
    anyOf
    and
    allOf
    style composition above?
    r
    • 2
    • 3
  • m

    mkobit

    05/16/2019, 7:26 PM
    is there a comparable to AssertJ's
    withFailMessage
    - https://joel-costigliola.github.io/assertj/core-8/api/org/assertj/core/api/AbstractAssert.html#withFailMessage-java.lang.String-java.lang.Object...- ?
    r
    c
    • 3
    • 3
  • m

    mkobit

    06/17/2019, 9:11 PM
    is
    strikt-protobuf
    intended to have APIs for both gRPC and protobuf, or only protobuf types? i'm wondering if it makes sense to add another
    strikt-grpc
    or to shove it into
    strikt-protobuf
    ?
    r
    • 2
    • 3
  • c

    christophsturm

    07/18/2019, 4:09 PM
    assertion errors on assertion errors are really mindboggling to read. #inception
    r
    • 2
    • 2
  • c

    christophsturm

    10/17/2019, 11:13 AM
    did you create a kotlin wrapper for this object diff lib?
    s
    r
    • 3
    • 6
Powered by Linen
Title
c

christophsturm

10/17/2019, 11:13 AM
did you create a kotlin wrapper for this object diff lib?
s

segunfamisa

10/17/2019, 11:30 AM
not sure if this was for me?
c

christophsturm

10/17/2019, 11:49 AM
no, but did you? i thought maybe robfletcher has one if he uses it at work
r

robfletcher

10/17/2019, 1:05 PM
No, we’re using it directly (from Kotlin code)
What are you thinking such a wrapper would add?
c

christophsturm

10/17/2019, 2:17 PM
not sure, i just skimmed over the docs and it seems to have a visitor based api, maybe that could be simplified with a lambda based api?
r

robfletcher

10/17/2019, 4:25 PM
Right. That’s probably true. I haven’t had to do anything too deep with it. We’re finding it pretty successful out of the box. We’re using it to diff desired and actual states of cloud resources, and record details of user updates to that desired state.
View count: 3