diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/leiningen.rb | 24 |
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 |
