https://kotlinlang.org logo
#kotest-contributors
Title
# kotest-contributors
s

sam

09/26/2021, 5:06 PM
@Emil Kantis you closed off the rename inspectors ticket, do you not want to do that anymore ?
e

Emil Kantis

09/26/2021, 5:08 PM
There was very little response in favor of doing it (or not doing it for that matter), so I thought we could drop it
we could go about adding the
shouldForX
as aliases if you want?
s

sam

09/26/2021, 5:22 PM
My only reluctance was that the new names weren't much better imo
were we changing for the sake of it ?
but I agree that inspectors aren't that well known
Copy code
cities.shouldForOne { 
   it.shouldHaveName("Chicago")
   it.shouldHaveState("IL")
}
vs
Copy code
cities.forOne { 
   it.shouldHaveName("Chicago")
   it.shouldHaveState("IL")
}
I would be happy to add shouldForX as aliases to the existing matchers
e

Emil Kantis

09/26/2021, 5:43 PM
I agree that
forOne
reads better and it’s a lot cleaner. A downside to the aliases would be consistency, and knowing what to prefer.. I still think it would be great for discoverability
s

sam

09/26/2021, 5:44 PM
The aliases won't hurt
Just don't deprecate the older ones
e

Emil Kantis

09/26/2021, 5:44 PM
Could adding them as deprecated, with a
ReplaceWith
each respective
forX
version serve a purpose? Or do you think that would be bad practice?
s

sam

09/26/2021, 5:44 PM
I'm reluctant to keep deprecating things as people put years into tests
e

Emil Kantis

09/26/2021, 5:44 PM
I mean that the added aliases would be flagged from the get-go.. 🙂
s

sam

09/26/2021, 5:45 PM
Oh i see
Interesting
What about a rule in the intellij plugin
e

Emil Kantis

09/26/2021, 5:45 PM
Ah, that’s probably better
that can be toggled off, if user desires to, right
s

sam

09/26/2021, 5:46 PM
Yep
e

Emil Kantis

09/26/2021, 5:47 PM
I really like that idea 🙂
s

sam

09/26/2021, 5:47 PM
Easy too
e

Emil Kantis

09/26/2021, 5:51 PM
I remember seeing something in github regarding someone testing
Boolean?
like
Copy code
val x: Boolean? = null
x shouldNotBe true
where the plugin suggested that it should be replaced by
Copy code
x shouldBe false
Did you pick that one up or perhaps that could be.a good thing to check out to learn a bit about the intellij plugin?
s

sam

09/26/2021, 5:52 PM
I haven't done that one
It just needs deleting
e

Emil Kantis

09/26/2021, 5:52 PM
Odd.. I can’t find it anymore either
s

sam

09/26/2021, 5:52 PM
It's a stupid rule
It's s good first ticket
2 Views