starting... lots of work to do
This commit is contained in:
parent
eca1c9e80c
commit
49e460a0b4
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
lib
|
19
README.markdown
Normal file
19
README.markdown
Normal file
@ -0,0 +1,19 @@
|
||||
# Functional Koans
|
||||
|
||||
### Getting Started
|
||||
|
||||
To download the dependencies, install leiningen
|
||||
(http://github.com/technomancy/leiningen). After you have leiningen
|
||||
installed run
|
||||
|
||||
`lein deps`
|
||||
|
||||
which will download all dependencies you need to run the clojure koans.
|
||||
|
||||
### Running The Koans
|
||||
|
||||
To run the koans, simply run
|
||||
|
||||
`ant`
|
||||
|
||||
which will run all the files in the koans directory.
|
22
build.xml
Normal file
22
build.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<project name="functional-koans" default="test">
|
||||
<description>
|
||||
functional-koans
|
||||
</description>
|
||||
|
||||
<path id="classpath">
|
||||
<path location="src"/>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<target name="test" description="Run tests">
|
||||
<java fork="true" classname="clojure.main" failonerror="true">
|
||||
<classpath>
|
||||
<path refid="classpath"/>
|
||||
<path location="koans"/>
|
||||
</classpath>
|
||||
<arg value="koans/path_to_enlightenment.clj"/>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
12
koans/about_asserts_test.clj
Normal file
12
koans/about_asserts_test.clj
Normal file
@ -0,0 +1,12 @@
|
||||
(ns about-asserts-test
|
||||
(:use clojure.test))
|
||||
|
||||
(deftest test-truth
|
||||
(testing "We shall contemplate truth by testing reality, via asserts."
|
||||
(assert false))) ;; This should be true
|
||||
|
||||
(deftest test-assert-equality
|
||||
(testing "To understand reality, we must compare our expectations against reality."
|
||||
(let [expected-value 0
|
||||
actual-value (+ 1 1)]
|
||||
(is (= expected-value actual-value)))))
|
20
koans/path_to_enlightenment.clj
Normal file
20
koans/path_to_enlightenment.clj
Normal file
@ -0,0 +1,20 @@
|
||||
(use 'clojure.contrib.find-namespaces
|
||||
'clojure.test)
|
||||
|
||||
(def exit-code (atom 0))
|
||||
|
||||
(defn find-tests []
|
||||
(filter
|
||||
#(re-find #"-test" (str %)) (find-namespaces-in-dir (java.io.File. "."))))
|
||||
|
||||
(defn require-tests []
|
||||
|
||||
(doseq [test (find-tests)]
|
||||
(require test)))
|
||||
|
||||
(require-tests)
|
||||
(let [results (apply merge-with + (map test-ns (find-tests)))]
|
||||
(if (or (> (results :fail) 0)
|
||||
(> (results :error) 0))
|
||||
(System/exit -1)
|
||||
(System/exit 0)))
|
6
project.clj
Normal file
6
project.clj
Normal file
@ -0,0 +1,6 @@
|
||||
(defproject functional-koans "0.0.1"
|
||||
:description "The functional koans"
|
||||
:dependencies [[org.clojure/clojure "1.1.0"]
|
||||
[org.clojure/clojure-contrib "1.0-SNAPSHOT"]]
|
||||
:dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]]
|
||||
:namespaces [koans])
|
Loading…
Reference in New Issue
Block a user