Fork me on GitHub
#clojure-uk
<
2017-05-24
>
paulspencerwilliams06:05:48

Morning. Apologies for being absent for a while. However, I’m back and I’ve got a challenge for you… I ran a session that was well received last night at the West Midlands Java User Group in the use of RDD for exploring Java libraries using Clojure. Attendees saw a lot of value in the REPL, and extracting examples out of REPL play into tests. However… The parens and syntax was a challenge for a few, and one attendee asked for examples of easy to read acceptance tests or integration tests written in Clojure. One’s that would be easy for testers to understand and maintain. Any suggestions?

seancorfield06:05:01

My recommendation tends to be stuff written with Expectations. We love that at World Singles.

seancorfield06:05:34

Not sure where to point you for an example body of such test code tho'

seancorfield06:05:58

It's funny how some people just can't get past the parens tho'... even tho' it's usually less actual "syntax" than whatever their home language is.

paulspencerwilliams07:05:07

Cheers @seancorfield. I agree regarding syntax. Once you’ve ‘seen the light’, it’s fine but initial impressions count.

paulspencerwilliams08:05:19

@mccraigmccraig good call. TBH I was being a little lazy and hoped individuals might know of a specifically good example. Your example complies 😉 Very easy to understand; the ‘in your face data’ nature of the tests is a great exampler. Thank you.

mccraigmccraig08:05:29

there's also quite a lot of java interop there to make java-heads feel more at home

agile_geek08:05:59

@iecya Nice to see you in the 'public' team FiFi! 👋

agile_geek09:05:01

@paulspencerwilliams expectations is cool but TBH I think you just need to get used to the syntax as most tests I see are in clojure.test. I used to prefer midje and the expectations for their readability but the tooling is just stronger around clojure.test and in the end that won the argument for me.

glenjamin09:05:54

I always liked speclj

mccraigmccraig09:05:00

i always found myself wrangling weird macroexpansion errors with midje

mccraigmccraig09:05:49

i've fallen back to clojure.test because it's ok and omnipresent

mccraigmccraig09:05:50

though it's crappy for async code (there is async support in cljs.test), but i'm not sure any of the other frameworks are any better for async code

agile_geek09:05:20

@glenjamin looked at speclj but not used it.. I like rspec

iecya09:05:48

@agile_geek thanks 😄 i finally made my debut!

agile_geek09:05:38

@iecya Well welcome. We're all pretty friendly here.

mccraigmccraig10:05:35

(when not grumpy)

yogidevbear11:05:43

mccraigmccraig: This sounds like an urban legend 😉

maleghast13:05:55

@mccraigmccraig - Thanks for the S3 stuff yesterday. I am going to put a pin in it and use the Filesystem until I have time to do the modifications I need. Have forked the gists so that I can let you see the modifications when I get to it 🙂

bronsa17:05:19

and then comes jdk9 to crush your dreams and hopes :)

mccraigmccraig17:05:35

gawd mutability suxx

dominicm17:05:03

jdk gotta keep delaying.

seancorfield19:05:11

Re: tooling / clojure.test — just FYI, Expectations now supports all the clojure.test tooling because it has named tests via defexpect (so the CIDER / ProtoREPL / etc workflows should all “just work”)… but it would be nice to get more widespread usage and more feedback 🙂