Tag: Clojure

Assertions and Invariants

I’ve been thinking a lot about testing frameworks over the past six months, and I’m not the only Stuart doing that. Stuart Halloway, who spent some time on his own Clojure testing framework, Circumspec, recently wrote about his experiences refactoring some of the language tests included with Clojure. One of Stu’s first points is that…

Read the full article

Slightly Less Typed Assertions

A couple of weeks ago I wrote about typed assertions for Lazytest. Like so many things, it seemed like a good idea at the time. Define typed objects for each kind of assertion (e.g., equality, instanceof). When a test fails, throw an exception with one such object as the payload. The type of the object…

Read the full article

Lazytest Churn

One of my stated goals with Lazytest was to enforce a clean separation between test assertions and code that runs before/around the assertions. The Spock framework for Java/Groovy calls these the stimulus and response, identified by the keywords when and then, respectively. I find this approach attractive, but one look at Spock’s documentation shows it’s…

Read the full article

Two Steps Forward, One Step Back

Following my last post I integrated typed assertions into the master branch of Lazytest. This makes some changes to the API. Test examples in the it macro can no longer simply return true or false. Instead, they must call the expect macro. The Context type is gone, replaced by the Fixture protocol. More documentation to…

Read the full article

Typed Assertions Tell You What Hurts

One thing clojure.test did reasonably well was tell you why an assertion failed. Currently, Lazytest fails in this regard. The problem with requiring test functions to return true/false to indicate pass/fail is that they can’t attach any additional information to a failure to explain why it failed. I realized that function return values are insufficient…

Read the full article

Spread Thin

With the profusion of “community” web sites around today, it’s getting hard to keep track of where your “community” is. For example, the “Clojure community” exists in 7 places: clojure.org (main documentation) Github (source code) Assembla (bug tracking) Wikibooks (more documentation) Google Groups (discussion) Google Code (downloads) Freenode (chat) That doesn’t include the defunct Sourceforge…

Read the full article

Clojure-Hadoop 1.0.0

At long last, I have made a formal release of my clojure-hadoop library. Downloads and more information here. The 1.0.0 release is documented, but not in exhaustive detail. Other people have used this successfully, but it may not support all possible Hadoop configurations. Watch video of my presentation at HadoopWorld NYC.

Agents of Swing

The title of this post would make a good name for a band. Anyway, today I’m going to talk about Swing and concurrency and Clojure. The Swing framework is not thread-safe. That may sound strange at first, but there’s actually some sound technical reasoning behind it. Basically, the Swing designers realized that, in order to…

Read the full article