Benjamin Esham <bdes...@gmail.com> writes:

Hi Benjamin,

>     (defn refer-private [ns] 
>       (doseq [[symbol var] (ns-interns ns)] 
>         (when (:private (meta var)) 
>           (intern *ns* symbol var)))) 
>
> As he says, "this is slightly evil, and I would never recommend it for
> any purpose except unit testing, but there it is." This works, and the
> macro approach also makes sense to me.

I use it, too.

> But these threads are respectively three and two years old. Have there
> been any changes in Clojure since then which solve this problem or
> provide a recommended workaround?

Not that I know of.

> (You might tell me that I should only test the user-facing parts of
> the library, since everything else is implementation details and these
> shouldn't be reflected in tests.

No.  Testing also the private functions helps to spot errors and
regressions as soon as possible.  You can still split the tests of the
public functions into a separate file and point users to that as usage
example.

Bye,
Tassilo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to