aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/leiningen.rb
diff options
context:
space:
mode:
authorTed Pennings2014-01-01 15:37:53 -0500
committerMike McQuaid2014-01-02 10:20:58 +0000
commit8bc79618cf6a84a6779afd2e8418cf99089a5ff1 (patch)
tree75a92fb87e322028284f13b6318cd6556bcf94b8 /Library/Formula/leiningen.rb
parent7c0a357a8ffa8539f24401983f959ab952c59940 (diff)
downloadhomebrew-8bc79618cf6a84a6779afd2e8418cf99089a5ff1.tar.bz2
leiningen: add a simple project for `brew test`.
Closes #25589. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/leiningen.rb')
-rw-r--r--Library/Formula/leiningen.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Formula/leiningen.rb b/Library/Formula/leiningen.rb
index df84d7aa6..427040346 100644
--- a/Library/Formula/leiningen.rb
+++ b/Library/Formula/leiningen.rb
@@ -31,4 +31,28 @@ class Leiningen < Formula
To play around with Clojure run `lein repl` or `lein help`.
EOS
end
+
+ test do
+ (testpath/'project.clj').write <<-EOS.undent
+ (defproject brew-test "1.0"
+ :dependencies [[org.clojure/clojure "1.5.1"]])
+ EOS
+ (testpath/'src/brew_test/core.clj').write <<-EOS.undent
+ (ns brew-test.core)
+ (defn adds-two
+ "I add two to a number"
+ [x]
+ (+ x 2))
+ EOS
+ (testpath/'test/brew_test/core_test.clj').write <<-EOS.undent
+ (ns brew-test.core-test
+ (:require [clojure.test :refer :all]
+ [brew-test.core :refer :all]))
+ (deftest canary-test
+ (testing "adds-two yields 4 for input of 2"
+ (is (= 4 (adds-two 2)))))
+ EOS
+ system "#{bin}/lein", 'test'
+ end
+
end