Re: Unit testing

2013-01-08 Thread Tony Pitluga
If you are coming from Ruby, there is speclj which has an RSpec feel. https://github.com/slagyr/speclj On Tue, Jan 8, 2013 at 1:57 PM, Sean Corfield wrote: > On Mon, Jan 7, 2013 at 11:50 PM, Eric MacAdie wrote: > > Is there a common unit testing framework for Clojure? I did some > googling, >

Re: Unit testing

2013-01-08 Thread Sean Corfield
On Mon, Jan 7, 2013 at 11:50 PM, Eric MacAdie wrote: > Is there a common unit testing framework for Clojure? I did some googling, > put all the results were a couple of years old. As others have noted separately, Clojure has clojure.test built-in which is fairly straightforward assertion-based:

Re: Unit testing

2013-01-08 Thread Alex Baranosky
There's also Midje: https://github.com/marick/Midje On Tue, Jan 8, 2013 at 12:54 AM, keeds wrote: > Expectations is a good framework. > > https://github.com/jaycfields/expectations > > > On Tuesday, January 8, 2013 7:50:05 AM UTC, Eric MacAdie wrote: >> >> Is there a common unit testing framewor

Re: Unit testing

2013-01-08 Thread keeds
Expectations is a good framework. https://github.com/jaycfields/expectations On Tuesday, January 8, 2013 7:50:05 AM UTC, Eric MacAdie wrote: > > Is there a common unit testing framework for Clojure? I did some googling, > put all the results were a couple of years old. > > - Eric MacAdie > > -

Re: Unit testing

2013-01-08 Thread Meikel Brandmeyer (kotarak)
Hi, Am Dienstag, 8. Januar 2013 08:50:05 UTC+1 schrieb Eric MacAdie: > > Is there a common unit testing framework for Clojure? I did some googling, > put all the results were a couple of years old. > > clojure.test ships with clojure proper. And midje is also very popular. Kind regards Meikel

Re: unit testing private methods?

2009-06-03 Thread Stuart Halloway
>> 2) put the unit tests in a separate file, in the same namespace This works for me, but since it won't work with the normal use/require idiom, I would like to see a standard convention evolve to make it easy to read other people's code. Stu --~--~-~--~~~---~--~

Re: unit testing private methods?

2009-06-03 Thread Christophe Grand
Stuart Sierra a écrit : > Stu's suggestion of with-ns would also work. But you don't even need > with-ns. You can refer a private function into the local namespace > like this: > > (def private-function (ns-resolve 'other-namespace 'private-function)) > And don't forget the good old @#'other

Re: unit testing private methods?

2009-06-03 Thread Stuart Sierra
Hi Allen, Stu, I guess my first inclination would be one of: > 1) put the unit tests in the same file using the with-test macro, or > 2) put the unit tests in a separate file, in the same namespace Stu's suggestion of with-ns would also work. But you don't even need with-ns. You can refer a pr

Re: unit testing private methods?

2009-06-03 Thread Andrew Wagner
Well, of course this is a classic situation in OO, if you think about it. Googling around may shed some interesting light on the subject. Essentially, the question is: are you sure that's what you want to do? Why not concentrate your unit tests on the public interface in such a way that the private

Re: unit testing private methods?

2009-06-03 Thread stephaner
Hi everyone, I agree with Stuart, this would be very helpfull. Thank you, Stephan On Jun 3, 12:36 am, Stuart Halloway wrote: > Hi Allen, > > You could write a function that uses the clojure.contrib.with-ns/with- > ns macro to dip into the namespace being tested and return the private   > func

Re: unit testing private methods?

2009-06-02 Thread Stuart Halloway
Hi Allen, You could write a function that uses the clojure.contrib.with-ns/with- ns macro to dip into the namespace being tested and return the private function, assigning it to a local name in the test namespace. I need this too, and have been meaning to ping the other Stuart about either

Re: Unit Testing Macros

2009-03-18 Thread Sean
Thanks to everyone who replied. After looking at the examples & a night's sleep, this makes sense. On Mar 18, 12:38 pm, Stuart Sierra wrote: > On Mar 17, 6:06 pm, Sean wrote: > > >    I'm writing a macro library for myself, and I'm thinking about > > publishing it.  Before I do so, I'd like to

Re: Unit Testing Macros

2009-03-18 Thread Stuart Sierra
On Mar 17, 6:06 pm, Sean wrote: >    I'm writing a macro library for myself, and I'm thinking about > publishing it.  Before I do so, I'd like to write & run some unit > tests for it.  I was hoping the crowd could chime in on how they test > macros.  Any links & examples would be great.  Thanks!

Re: Unit Testing Macros

2009-03-17 Thread Cosmin Stejerean
On Tue, Mar 17, 2009 at 5:06 PM, Sean wrote: > > Hey everyone, > I'm writing a macro library for myself, and I'm thinking about > publishing it. Before I do so, I'd like to write & run some unit > tests for it. I was hoping the crowd could chime in on how they test > macros. Any links & ex