marick/Midje — Issue #84: Mocking Java static methods
Author: AlexBaranosky
Created: 2012-01-06 03:13:07+00:00
State: open
Labels: wishlist

enable writing this fact from t_colorize.clj as:

```clojure
(fact "access environment vars only when namespace is loaded"
(do
(color/fail "a")
(color/note "b")
(color/fail "c")
(color/note "d")) => anything
(provided
(System/getenv "MIDJE_COLORIZE") => anything :times 0))
```

So we don't need to make wrapper funtions just for testing like we did with:

```clojure
(defn getenv [s]
(System/getenv s))
```

My first plan is to look at the Java PowerMock testing library, which can mock static methods. Then the trick to add the bells and whistles, like call count and such.