File tree 3 files changed +24
-21
lines changed
3 files changed +24
-21
lines changed Original file line number Diff line number Diff line change 2
2
3
3
(it "finds the tests in the runner_tests folder"
4
4
(expect (find-tests "./runner_tests")
5
- to (be_empty ) <<<<<<<< ??????
5
+ to (be :empty ) <<<<<<<< ??????
6
6
to (equal '("suite_one.clj")))))
7
7
8
- - Assertion failures should report the line number they're failing on
8
+ - Assertion failures should report the line number they're failing on
Original file line number Diff line number Diff line change 3
3
(use 'probe.runner)
4
4
(use 'clojure.contrib.seq-utils)
5
5
6
- (defmulti pending-for-type :type )
7
-
8
- (defmethod pending-for-type :context [context]
9
- (let [tests (:tests context)]
10
- (if (empty? tests)
11
- true
12
- (find-first pending-for-type tests))))
13
-
14
- (defmethod pending-for-type :test [test]
15
- (empty? (:tests test)))
16
-
17
- (defmethod pending-for-type :expects [test]
18
- (empty? (:tests test)))
19
-
20
- (defn is-pending [coll]
21
- (let [result (find-first pending-for-type (flatten [coll]))]
22
- (not (or (nil? result) (empty? result)))))
6
+ ; ; The two default data structures are defined below
7
+ ; ; Everything is stored as either a context or a test.
23
8
24
9
(defstruct context-info
25
10
:type
26
11
:doc
27
12
:tests )
28
13
29
- ; ; TODO: There has to be a reasonable way to do this
30
- ; ; in clojure
31
14
(def default-context
32
15
(struct-map context-info
33
16
:type :context
40
23
:doc " "
41
24
:tests []))
42
25
26
+ (defmulti pending-for-type :type )
27
+
28
+ (defmethod pending-for-type :context [context]
29
+ (let [tests (:tests context)]
30
+ (if (empty? tests)
31
+ true
32
+ (find-first pending-for-type tests))))
33
+
34
+ (defmethod pending-for-type :test [test]
35
+ (empty? (:tests test)))
36
+
37
+ (defmethod pending-for-type :expects [test]
38
+ (empty? (:tests test)))
39
+
40
+ (defn is-pending [coll]
41
+ (let [result (find-first pending-for-type (flatten [coll]))]
42
+ (not (or (nil? result)
43
+ (empty? result)))))
44
+
45
+
43
46
(defn context
44
47
([doc] (assoc default-context :doc doc))
45
48
([doc & children]
You can’t perform that action at this time.
0 commit comments