kotest / kotest-extensions-arrow

Kotest extensions for Arrow
Apache License 2.0
40 stars 13 forks source link

shouldBeLeft / shouldBeRight no longer support infix functions #12

Closed codymikol closed 3 years ago

codymikol commented 3 years ago

Hello,

we noticed that after the 1.0.3 update the library no longer supports infix functions on shouldBeLeft / shouldBeRight

Where previously we were doing something like

eitherFoo shouldBeRight {
  this.bar shouldBe 1
}

and now we have to migrate everything to something like

val eitherFooRight = eitherFoo.shouldBeRight()
eitherFooRight.bar shouldBe 1

Was this an intentional change, or did something get lost in translation to the new core library? If this was unintentional, I can put in some effort to add back the infix functionality.

Thanks for all your work on the project!

sksamuel commented 3 years ago

@i-walker can you comment ?

i-walker commented 3 years ago

The previous approach was boilerplate over the kotest Api's, to have a more succinct API that accompanies kotest assertion this should be rewritten to:

eitherFoo.shouldBeRight().bar shouldBe 1
sksamuel commented 3 years ago

@codymikol are you ok now ?

codymikol commented 3 years ago

This makes perfect sense to me 👍 Thank you for the clarification!

i-walker commented 3 years ago

Your welcome @codymikol :D