https://kotlinlang.org logo
#mockk
Title
# mockk
m

Matteo Mirk

03/06/2023, 10:30 AM
Is there a way to configure Mockk at a global level? Say, for example, I'd like all mocks to be relaxed by default.
m

Mattia Tommasone

03/06/2023, 10:33 AM
yep ci sta 🙂 give me a sec to dig it up
relaxed=true
is what you’re looking for
BUT
keep in mind that there is a philosophical argument that mocks should generally be strict and you should just relax them when you really need to
m

Matteo Mirk

03/06/2023, 10:36 AM
Yeah, thanks I know. "relaxed" was just an example, because I couldn't find global settings in the docs... thanks Mattia!
m

Mattia Tommasone

03/06/2023, 10:37 AM
i personally don’t have a very strong opinion about strict vs relaxed mocks, but i know people who do 😄
t

thanksforallthefish

03/06/2023, 1:06 PM
I know people who have strong opinions about mocking interfaces only, and people who have strong opinion against mocking in general. you just can’t please everybody 😄 (sorry, I know it is not contributing to the discussion, feel free to ignore me)
j

Jacob

03/06/2023, 1:09 PM
I like to relax. I feel like mockito docs used to encourage relaxed style, and then pivoted.
8 Views