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
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
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
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
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,
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.
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
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
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