technomancy/slamhound

Slamhound throws exception on midje checkers

rdoh opened this issue · 2 comments

rdoh commented

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

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

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!