technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.
Other
473 stars 38 forks source link

Slamhound throws exception on midje checkers #37

Closed rdoh closed 11 years ago

rdoh commented 11 years ago

Running slamhound on this code:

(ns foo
  (:use midje.sweet))
(defn kill-slamhound []
  (throws Exception ("bar")))

causes:

UnsupportedOperationException nth not supported on this type: Symbol clojure.lang.RT.nthFrom (RT.java:857)

Everything is fine if I explicitly require the checker from its own namespace like this:

(ns foo
  (:require [midje.checking.checkers.simple :as checkers]))
(defn kill-slamhound []
  (checkers/throws Exception "bar"))

I assume this is a result of the macro "shortcomings" mentioned in the docs but thought it was worth reporting as it prevents us running slamhound on our test suite.

guns commented 11 years ago

Hello,

Current master transforms your buffer:

(ns foo
  (:use midje.sweet))

(defn kill-slamhound []
  (throws Exception ("bar")))

into:

(ns foo
  (:require [midje.sweet :refer :all]))

(defn kill-slamhound []
  (throws Exception ("bar")))

Could you please test and corroborate?

guns commented 11 years ago

Hello @rdoh,

It seems this issue has been addressed by recent changes, so I am going to close.

If you believe this is in error, please feel free to re-open!