From c215fb9980d550caf288a8a7a15a617b30d59b96 Mon Sep 17 00:00:00 2001 From: Alex Baranosky Date: Sat, 18 Feb 2012 21:09:06 -0500 Subject: [PATCH] [Issue #82] removed unused code --- FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md | 0 src/midje/unprocessed.clj | 41 +++++++++++++-------------- 2 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md diff --git a/FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md b/FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md new file mode 100644 index 000000000..e69de29bb diff --git a/src/midje/unprocessed.clj b/src/midje/unprocessed.clj index 5137d08ee..3435c86f9 100644 --- a/src/midje/unprocessed.clj +++ b/src/midje/unprocessed.clj @@ -34,28 +34,25 @@ :expected (:expected-result-text-for-failures call)}) (check-result-positive [report-fn actual call] - (report-fn - (merge - (cond (extended-= actual (:expected-result call)) - {:type :pass} - - (chatty-checker? (:expected-result call)) - (merge (fail :mock-expected-result-functional-failure actual call) - (let [chatty-result ((:expected-result call) actual)] - (if (map? chatty-result) - chatty-result - {:notes ["Midje program error. Please report." - (str "A chatty checker returned " - (pr-str chatty-result) - " instead of a map.")]}))) - - (fn? (:expected-result call)) - (fail :mock-expected-result-functional-failure actual call) - - :else (assoc (fail :mock-expected-result-failure actual call) - :expected (:expected-result call))) - - (when (:formula call) {:store-report true})))) + (cond (extended-= actual (:expected-result call)) + (report-fn {:type :pass}) + + (chatty-checker? (:expected-result call)) + (report-fn (merge (fail :mock-expected-result-functional-failure actual call) + (let [chatty-result ((:expected-result call) actual)] + (if (map? chatty-result) + chatty-result + {:notes ["Midje program error. Please report." + (str "A chatty checker returned " + (pr-str chatty-result) + " instead of a map.")]})))) + + (fn? (:expected-result call)) + (report-fn (fail :mock-expected-result-functional-failure actual call)) + + :else + (report-fn (assoc (fail :mock-expected-result-failure actual call) + :expected (:expected-result call))))) (check-result-negated [report-fn actual call] (cond (not (extended-= actual (:expected-result call)))