Literate programming/TDD with Leiningen + midje + marginalia

2011-12-22 Thread Adam Getchell
Thanks for all the replies! I'm trying midje first (keeping expectations in mind for later) as it seems to support writing tests and then code (i.e. top down testing). (This video https://github.com/marick/Midje/wiki/Top-down-testing was useful, thanks for making it!) In generating

Re: Literate programming/TDD with Leiningen + midje + marginalia

2011-12-22 Thread Alex Baranosky
Hi Adam, It seems like making it so that Marginalia allows you to specify which directories to use would be the ideal case, instead of feeling a need to lump all your tests in the src directory. I wonder if Marginalia already supports this? Alex On Wed, Dec 21, 2011 at 11:25 PM, Adam Getchell

Re: Literate programming/TDD with Leiningen + midje + marginalia

2011-12-22 Thread Linus Ericsson
Yes, it does. I had problems with some midje-facts crashing the rendering in marginalia, but was able to just give the files as consecutive arguments as a work around. lein marg src/app/core.clj src/app/another/file.clj wildcards works fine as well. This problem with midje-facts being

Re: TDD with Leiningen

2011-12-08 Thread Brian Marick
I don't know if you got any answers. If you're not wedded to clojure.test, the examples of Midje here may help: https://github.com/marick/Midje On Dec 1, 2011, at 12:30 AM, Adam Getchell wrote: Hello, I'm porting a scientific application written in SBCL to Clojure. I'd like to do the

Re: TDD with Leiningen

2011-12-08 Thread Kevin Downey
ala carte testing is easy, clojure comes with a testing library called 'clojure.test' the simplest way to test functions is to define tests using deftest, and to assert things using is (use '[clojure.test :only [deftest is]]) (defn foo [x] (+ x 1)) (deftest test-foo ;; deftest creates a var,

Re: TDD with Leiningen

2011-12-08 Thread Jay Fields
My response is similar to Brian's: If you want to try something other than clojure.test, you might like https://github.com/jaycfields/expectations specifically, it plays well with IntelliJ, and gives you an easy way to run all your clojure tests using IntelliJ's built in junit integration.

TDD with Leiningen

2011-12-01 Thread Adam Getchell
Hello, I'm porting a scientific application written in SBCL to Clojure. I'd like to do the right thing by setting up tests to ensure my functions are correct, and package up the project correctly using Leiningen. I've read Clojure in Action, however, the sample code from Chapter 8, which details

Re: TDD with Leiningen

2011-12-01 Thread Adam Getchell
So, here's an example: In the file C:\Projects\CDT\Newton\src\Newton.utilities.clj I have: (ns Newton.utilities) ;; To keep same name conventions as utilities.lisp ;; In idomatic clojure, this could be replaced by the anonymous function ;; #(apply + %) (defn sum sums the elements of a list

Re: TDD with Leiningen

2011-12-01 Thread Adam Getchell
So, figured out my error, thanks for listening: C:\Projects\CDT\Newton\test\Newton\test\core.clj: (ns Newton.test.core (:use [Newton.core]) (:use [clojure.test]) (:use [Newton.utilities])) (deftest sum-test (is (= (sum '(1 2 3 4 5)) 15))) Then: PS C:\Projects\CDT\Newton lein test