marick / Midje

Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing
MIT License
1.69k stars 129 forks source link

Colorizing report output #68

Closed AlexBaranosky closed 12 years ago

AlexBaranosky commented 12 years ago

Seems like a good idea. I'm still wondering: What's a sane way to allow the user to opt-out of colorization?

AlexBaranosky commented 12 years ago

I've got a decent looking colorized version of the report code, cake summary and lein-plugin summary, but no way for the user to turn it on or off. I'm not sure if we need that feature, or if colors should just be the only option. I've got it on a local branch... Let me know what you think.

AlexBaranosky commented 12 years ago

Ideas based on IRC chat with Alan Malloy and Chris Granger, on the subject of how to best go about making the colorization togglable:

AlexBaranosky commented 12 years ago

The JVM does not have a simple way to set an environment variable. IT can read one, but can't set one (without a crazy hack).

Two options I can think of:

I plan to go with option 2. Let me know if it stinks. :)

AlexBaranosky commented 12 years ago

Pushed code to make FAIL lines red, and WORK TO DO lines yellow in the shell. This can be turned off by setting the environment variable MIDJE_COLORIZE=FALSE. Next to do is to edit the cake plugin code to make ">>> clojure.test summary:" and ">>> Midje summary:" both be green. (plan to make same change to lein-midje)