(obviously with a better name than `f`)
# strikt
r
(obviously with a better name than
f
)
c
field
?
you can already use chain{} inside the expect block, do you want a shorter name or what is the usecase?
r
yeah, I’m not sure. Something’s bothering me but I can’t quite put my finger on it
c
maybe we should really call it
f{..}
?
then you can really do
Copy code
expect(foo) {
  f{it.bar}.isEqualTo("o hai")
  f{it.baz}.isEqualTo("kthxbye")
}
or remove the it syntax again, then you can write f{bar}
r
I’m wondering if it might even make sense to make the signature
expectThat
Assertion.Builder<T>.(T)->Unit
c
to make it nicer to read?
r
right
c
makes sense, but for map/chain i think its nicer without
r
I agree
I guess the name
chain
might be what I don’t like
c
yeah, map was nice, chain makes sense but is not so nice
r
it’s frustrating I couldn’t get both to be called
map
without creating multiple sub-interfaces which made declaring extension functions awkward
c
Copy code
expect(foo) {
  f(bar).isEqualTo("o hai")
  f(baz).isEqualTo("kthxbye")
}
is also doable, but only with source code reading
the problem with source code reading is that its tied to the jvm
r
yeah
c
why not call it
m
for map, or
f
for field?
r
and only if you have access to the source code
c
but you have that usually when running the tests
r
yeah 99% of the time
c
i think field reads pretty good
Copy code
expectThat(user) { field{lastName}.endsWith("owie") }