Skip to content

Commit beb3ed3

Browse files
vemvbbatsov
authored andcommitted
Add a testing
1 parent f494c8d commit beb3ed3

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/refactor_nrepl/integration_tests.clj

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns refactor-nrepl.integration-tests
2-
(:require [clojure.test :refer [deftest is use-fixtures]]
2+
(:require [clojure.test :refer [deftest is use-fixtures testing]]
33
[nrepl.server :as nrepl]
44
[refactor-nrepl middleware
55
[analyzer :as analyzer]
@@ -36,15 +36,15 @@
3636
:line 6 :column 19
3737
:name "foo" :dir test-project-dir)
3838
result (remove keyword? response)]
39+
(testing (pr-str result)
40+
(is (= 3 (count result)) (format "expected 3 results but got %d" (count result)))
41+
(is (every? (partial re-matches #"(?s).*(one|two)\.clj.*") result) "one.clj or two.clj not found in result")
3942

40-
(is (= 3 (count result)) (format "expected 3 results but got %d" (count result)))
41-
(is (every? (partial re-matches #"(?s).*(one|two)\.clj.*") result) "one.clj or two.clj not found in result")
42-
43-
(is (some (partial re-matches #"(?s).*one.clj \[2\].*") result) "call of foo not found in ns com.example.one")
43+
(is (some (partial re-matches #"(?s).*one.clj \[2\].*") result) "call of foo not found in ns com.example.one")
4444

45-
(is (some (partial re-matches #"(?s).*one.clj \[6\].*") result) "call of foo not found in ns com.example.one")
45+
(is (some (partial re-matches #"(?s).*one.clj \[6\].*") result) "call of foo not found in ns com.example.one")
4646

47-
(is (some (partial re-matches #"(?s).*two.clj \[3\].*") result) "def of foo not found in ns com.example.two")))
47+
(is (some (partial re-matches #"(?s).*two.clj \[3\].*") result) "def of foo not found in ns com.example.two"))))
4848

4949
(defn ns-ast-throw-error-for-five [^String content]
5050
(if (.contains content "com.example.five")
@@ -60,14 +60,16 @@
6060
:name "foo" :dir test-project-dir)
6161
result (remove keyword? response)]
6262

63-
(is (= 3 (count result)) (format "expected 3 results but got %d" (count result)))
64-
(is (every? (partial re-matches #"(?s).*(one|two)\.clj.*") result) "one.clj or two.clj not found in result")
63+
(testing (pr-str result)
6564

66-
(is (some (partial re-matches #"(?s).*one.clj \[2\].*") result) "call of foo not found in ns com.example.one")
65+
(is (= 3 (count result)) (format "expected 3 results but got %d" (count result)))
66+
(is (every? (partial re-matches #"(?s).*(one|two)\.clj.*") result) "one.clj or two.clj not found in result")
6767

68-
(is (some (partial re-matches #"(?s).*one.clj \[6\].*") result) "call of foo not found in ns com.example.one")
68+
(is (some (partial re-matches #"(?s).*one.clj \[2\].*") result) "call of foo not found in ns com.example.one")
6969

70-
(is (some (partial re-matches #"(?s).*two.clj \[3\].*") result) "def of foo not found in ns com.example.two"))))
70+
(is (some (partial re-matches #"(?s).*one.clj \[6\].*") result) "call of foo not found in ns com.example.one")
71+
72+
(is (some (partial re-matches #"(?s).*two.clj \[3\].*") result) "def of foo not found in ns com.example.two")))))
7173

7274
(deftest test-shouldnt-find-str-in-assert
7375
(let [transport (connect :port 7777)

0 commit comments

Comments
 (0)