Permalink
Browse files

Add an integ test for the pedestal app [IMMUTANT-253]

  • Loading branch information...
1 parent 2134f46 commit 4080148722102f1599ee747d0f11566ad467d10f @jcrossley3 jcrossley3 committed Mar 25, 2013
@@ -98,6 +98,14 @@
(defmacro for-each-version [& body]
`(for-each-version* (fn [] ~@body)))
+(defn version? [v]
+ (.startsWith
+ (:full *current-clojure-version*)
+ (str v)))
+
+(defn version []
+ (:full *current-clojure-version*))
+
(defn ns-from-property []
"Gets the namespace to test from the system property 'ns'"
(let [value (System/getProperty "ns")]
@@ -16,14 +16,13 @@
;; 02110-1301 USA, or see the FSF site: http://www.fsf.org.
(ns immutant.integs.web.noir
- (:use [fntest.core])
- (:use clojure.test)
+ (:use fntest.core
+ clojure.test
+ immutant.integs)
(:require [clj-http.client :as client]))
(defn run-tests? []
- (not (.startsWith
- (:full immutant.integs/*current-clojure-version*)
- "1.5")))
+ (not (version? 1.5)))
(let [file *file*]
(use-fixtures :once #(if (run-tests?)
@@ -0,0 +1,36 @@
+;; Copyright 2008-2013 Red Hat, Inc, and individual contributors.
+;;
+;; This is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU Lesser General Public License as
+;; published by the Free Software Foundation; either version 2.1 of
+;; the License, or (at your option) any later version.
+;;
+;; This software is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; Lesser General Public License for more details.
+;;
+;; You should have received a copy of the GNU Lesser General Public
+;; License along with this software; if not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+(ns immutant.integs.web.pedestal
+ (:use fntest.core
+ clojure.test
+ immutant.integs)
+ (:require [clj-http.client :as client]))
+
+(deftest get-hello
+ (if (every? (complement version?) [1.3 1.4])
+ ((with-deployment "hello"
+ {
+ :root "target/apps/pedestal/hello"
+ :context-path "/"
+ })
+ (fn []
+ (is (= (:body (client/get "http://localhost:8080/"))
+ "Hello World!"))
+ (is (= (:body (client/get "http://localhost:8080/about"))
+ (str "Clojure " (version))))))
+ (println "==> skipping pedestal tests since it requires 1.5 or higher")))

0 comments on commit 4080148

Please sign in to comment.