Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 12:58 pm, Stuart Halloway wrote: > Hi Berlin, > > Your testDog needs a 'this' argument: > > (defn -testDog [this] > (println "Dog called on " this)) > > I played with generating JUnit classes when I started writing the > book, and unless you have a specific need I would recommend u

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread Stuart Halloway
Hi Berlin, Your testDog needs a 'this' argument: (defn -testDog [this] (println "Dog called on " this)) I played with generating JUnit classes when I started writing the book, and unless you have a specific need I would recommend using something like test-is for Clojure testing. Cheers,

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 12:39 pm, BerlinBrown wrote: > On Feb 11, 12:21 pm, Stuart Sierra > wrote: > > > On Feb 11, 11:46 am, BerlinBrown wrote: > > > > (defn -init [] ()) > > > > (defn -testDog [] > > > (println "Dog")) > > > There's your problem: Java methods always need an extra first > > argument, t

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 12:21 pm, Stuart Sierra wrote: > On Feb 11, 11:46 am, BerlinBrown wrote: > > > (defn -init [] ()) > > > (defn -testDog [] > > (println "Dog")) > > There's your problem: Java methods always need an extra first > argument, the object on which the method was called. It's like the >

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread Stuart Sierra
On Feb 11, 11:46 am, BerlinBrown wrote: > (defn -init [] ()) > > (defn -testDog [] >   (println "Dog")) There's your problem: Java methods always need an extra first argument, the object on which the method was called. It's like the "this" keyword in Java. -Stuart Sierra --~--~-~--~---

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 11:56 am, ".Bill Smith" wrote: > Is it fair to say you really want to use Junit rather than the test > framework in clojure-contrib? I can think of reasons why you might > want to use Junit but I don't want to put words in your mouth. > > Bill "I am trying to use Junit to generate

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread .Bill Smith
Is it fair to say you really want to use Junit rather than the test framework in clojure-contrib? I can think of reasons why you might want to use Junit but I don't want to put words in your mouth. Bill --~--~-~--~~~---~--~~ You received this message because you

Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
I asked this on IRC yesterday. I think Chouser had a good suggestion but I forgot what it was. I am trying to use Junit to generate tests with Clojure. May not be the best to use junit but I was going to try anyway. main.clj: (compile 'test.OctaneTestGen) (ns test.OctaneTestGen (:gen-cla