This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-24
Channels
- # beginners (12)
- # cider (3)
- # clara (3)
- # cljs-dev (3)
- # cljsrn (19)
- # clojure (83)
- # clojure-android (1)
- # clojure-dev (15)
- # clojure-dusseldorf (1)
- # clojure-greece (30)
- # clojure-italy (10)
- # clojure-madison (1)
- # clojure-nl (6)
- # clojure-russia (274)
- # clojure-spec (51)
- # clojure-uk (31)
- # clojurescript (38)
- # core-async (7)
- # cursive (11)
- # datascript (1)
- # datomic (63)
- # emacs (10)
- # figwheel (1)
- # hoplon (27)
- # jobs (11)
- # klipse (4)
- # lein-figwheel (1)
- # lumo (6)
- # nyc (1)
- # off-topic (278)
- # om (12)
- # pedestal (10)
- # protorepl (31)
- # re-frame (13)
- # reagent (23)
- # remote-jobs (1)
- # spacemacs (9)
- # untangled (24)
- # yada (54)
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?
My recommendation tends to be stuff written with Expectations. We love that at World Singles.
Not sure where to point you for an example body of such test code tho'
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.
Cheers @seancorfield. I agree regarding syntax. Once you’ve ‘seen the light’, it’s fine but initial impressions count.
@paulspencerwilliams have you checked out tests for some well-know libs, e.g. ring - https://github.com/ring-clojure/ring/blob/master/ring-core/test/ring/core/test/protocols.clj
@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.
there's also quite a lot of java interop there to make java-heads feel more at home
@iecya Nice to see you in the 'public' team FiFi! 👋
@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.
i always found myself wrangling weird macroexpansion errors with midje
i've fallen back to clojure.test
because it's ok and omnipresent
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
e.g. see the mess here https://github.com/employeerepublic/deferst/blob/master/test/deferst/system_test.cljc#L60
@glenjamin looked at speclj but not used it.. I like rspec
@agile_geek thanks 😄 i finally made my debut!
@iecya Well welcome. We're all pretty friendly here.
(when not grumpy)
mccraigmccraig: This sounds like an urban legend 😉
@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 🙂
gawd mutability suxx
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 🙂