From 342ea417801f7d47b3f64fca329b0bbbf94fea27 Mon Sep 17 00:00:00 2001 From: Stuart Sierra Date: Fri, 13 Aug 2010 10:06:53 -0400 Subject: Fix remaining dependency issues in modular build --- modules/miglayout/pom.xml | 22 +++++++++ modules/mock/pom.xml | 5 +++ .../clojure/clojure/contrib/mock/test_adapter.clj | 52 +++++++++++++++------- modules/parent/pom.xml | 24 +++++++++- modules/probabilities/pom.xml | 10 +++++ modules/sql/pom.xml | 15 +++++++ modules/strint/pom.xml | 5 +++ 7 files changed, 116 insertions(+), 17 deletions(-) diff --git a/modules/miglayout/pom.xml b/modules/miglayout/pom.xml index c94b6726..22328c7e 100644 --- a/modules/miglayout/pom.xml +++ b/modules/miglayout/pom.xml @@ -11,4 +11,26 @@ ../parent miglayout + + + org.clojure.contrib + core + 1.3.0-SNAPSHOT + + + org.clojure.contrib + except + 1.3.0-SNAPSHOT + + + org.clojure.contrib + fcase + 1.3.0-SNAPSHOT + + + org.clojure.contrib + string + 1.3.0-SNAPSHOT + + \ No newline at end of file diff --git a/modules/mock/pom.xml b/modules/mock/pom.xml index e6eedcf1..d0bf1ee5 100644 --- a/modules/mock/pom.xml +++ b/modules/mock/pom.xml @@ -22,5 +22,10 @@ seq 1.3.0-SNAPSHOT + + org.clojure.contrib + ns-utils + 1.3.0-SNAPSHOT + \ No newline at end of file diff --git a/modules/mock/src/test/clojure/clojure/contrib/mock/test_adapter.clj b/modules/mock/src/test/clojure/clojure/contrib/mock/test_adapter.clj index 5f21ce11..466cb537 100644 --- a/modules/mock/src/test/clojure/clojure/contrib/mock/test_adapter.clj +++ b/modules/mock/src/test/clojure/clojure/contrib/mock/test_adapter.clj @@ -1,18 +1,38 @@ -(ns clojure.contrib.test-contrib.mock-test.test-adapter-test - (:use clojure.contrib.mock.test-adapter - [clojure.contrib.test-contrib.mock-test :only (assert-called)] - clojure.test)) - -(deftest test-report-problem-called - (def #^{:private true :dynamic true} fn1 (fn [x] "dummy code")) - (def #^{:private true :dynamic true} fn2 (fn [x y] "dummy code2")) - (let [under-test (fn [x] (fn1 x))] - (assert-called clojure.contrib.mock.test-adapter/report-problem - true (expect [fn1 (times 5)] (under-test "hi"))))) - -(deftest test-is-report-called - (assert-called clojure.test/report true - (clojure.contrib.mock.test-adapter/report-problem - 'fn-name 5 6 "fake problem"))) +;;; test_adapter.clj: clojure.test adapter for mocking/expectation framework for Clojure + +;; by Matt Clark + +;; Copyright (c) Matt Clark, 2009. All rights reserved. The use +;; and distribution terms for this software are covered by the Eclipse +;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php). +;; By using this software in any fashion, you are +;; agreeing to be bound by the terms of this license. You must not +;; remove this notice, or any other, from this software. + +(ns clojure.contrib.mock.test-adapter + (:require [clojure.contrib.mock :as mock]) + (:use clojure.test + clojure.contrib.ns-utils)) + +(immigrate 'clojure.contrib.mock) + +(defn report-problem + "This function is designed to be used in a binding macro to override +the report-problem function in clojure.contrib.mock. Instead of printing +the error to the console, the error is logged via clojure.test." + {:dynamic true} + [fn-name expected actual msg] + (report {:type :fail, + :message (str msg " Function name: " fn-name), + :expected expected, + :actual actual})) + + +(defmacro expect [& body] + "Use this macro instead of the standard c.c.mock expect macro to have +failures reported through clojure.test." + `(binding [mock/report-problem report-problem] + (mock/expect ~@body))) + diff --git a/modules/parent/pom.xml b/modules/parent/pom.xml index 0e5ba9d0..1ca8f959 100644 --- a/modules/parent/pom.xml +++ b/modules/parent/pom.xml @@ -6,7 +6,7 @@ http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - 1.2.0-RC1 + 1.2.0-RC3 UTF-8 org.clojure.contrib @@ -64,4 +64,26 @@ + + + clojure-snapshots + http://build.clojure.org/snapshots + + false + + + true + + + + clojure-releases + http://build.clojure.org/releases + + true + + + false + + + diff --git a/modules/probabilities/pom.xml b/modules/probabilities/pom.xml index 5f478a18..b55353bc 100644 --- a/modules/probabilities/pom.xml +++ b/modules/probabilities/pom.xml @@ -22,5 +22,15 @@ monads 1.3.0-SNAPSHOT + + org.clojure.contrib + macros + 1.3.0-SNAPSHOT + + + org.clojure.contrib + stream-utils + 1.3.0-SNAPSHOT + \ No newline at end of file diff --git a/modules/sql/pom.xml b/modules/sql/pom.xml index de94c477..998a5cad 100644 --- a/modules/sql/pom.xml +++ b/modules/sql/pom.xml @@ -22,5 +22,20 @@ string 1.3.0-SNAPSHOT + + org.clojure.contrib + except + 1.3.0-SNAPSHOT + + + org.clojure.contrib + properties + 1.3.0-SNAPSHOT + + + org.clojure.contrib + seq + 1.3.0-SNAPSHOT + \ No newline at end of file diff --git a/modules/strint/pom.xml b/modules/strint/pom.xml index 87a0a49f..81d55a41 100644 --- a/modules/strint/pom.xml +++ b/modules/strint/pom.xml @@ -12,5 +12,10 @@ strint + + org.clojure.contrib + with-ns + 1.3.0-SNAPSHOT + \ No newline at end of file -- cgit v1.2.3-18-g5258