Skip to content

Commit 7a72259

Browse files
vspinubbatsov
authored andcommitted
Fix tests
1 parent 61c1f0b commit 7a72259

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

cider-interaction.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ and all ancillary CIDER buffers."
17851785
(if (and quit-all (y-or-n-p "Are you sure you want to quit all CIDER connections? "))
17861786
(progn
17871787
(when-let ((scratch (get-buffer cider-scratch-buffer-name)))
1788-
(when (y-or-n-p (format "Kill %s? buffer" cider-scratch-buffer-name))
1788+
(when (y-or-n-p (format "Kill %s buffer? " cider-scratch-buffer-name))
17891789
(kill-buffer cider-scratch-buffer-name)))
17901790
(dolist (connection cider-connections)
17911791
(cider--quit-connection connection))

test/cider-apropos-tests.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
(describe "cider-apropos"
3535
(it "raises user-error when cider is not connected."
3636
(spy-on 'cider-connected-p :and-return-value nil)
37-
(expect (lambda () (cider-apropos "test")) :to-throw 'user-error))
37+
(expect (cider-apropos "test") :to-throw 'user-error))
3838

3939
(it "raises user-error when the `apropos' op is not supported."
4040
(spy-on 'cider-ensure-op-supported :and-return-value nil)
41-
(expect (lambda () (cider-apropos "test")) :to-throw 'user-error)))
41+
(expect (cider-apropos "test") :to-throw 'user-error)))
4242

4343
(describe "cider-apropos-documentation"
4444
(it "raises user-error when cider is not connected."
4545
(spy-on 'cider-connected-p :and-return-value nil)
46-
(expect (lambda () (cider-apropos-documentation)) :to-throw 'user-error))
46+
(expect (cider-apropos-documentation) :to-throw 'user-error))
4747

4848
(it "raises user-error when the `apropos' op is not supported."
4949
(spy-on 'cider-ensure-op-supported :and-return-value nil)
50-
(expect (lambda () (cider-apropos-documentation)) :to-throw 'user-error)))
50+
(expect (cider-apropos-documentation) :to-throw 'user-error)))

test/cider-classpath-tests.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
(describe "cider-classpath"
3535
(it "raises user-error when cider is not connected."
3636
(spy-on 'cider-connected-p :and-return-value nil)
37-
(expect (lambda () (cider-classpath)) :to-throw 'user-error))
37+
(expect (cider-classpath) :to-throw 'user-error))
3838

3939
(it "raises user-error when the `classpath' op is not supported."
4040
(spy-on 'cider-ensure-op-supported :and-return-value nil)
41-
(expect (lambda () (cider-classpath)) :to-throw 'user-error)))
41+
(expect (cider-classpath) :to-throw 'user-error)))
4242

4343
(describe "cider-open-classpath-entry"
4444
(it "raises user-error when cider is not connected."
4545
(spy-on 'cider-connected-p :and-return-value nil)
46-
(expect (lambda () (cider-open-classpath-entry)) :to-throw 'user-error))
46+
(expect (cider-open-classpath-entry) :to-throw 'user-error))
4747

4848
(it "raises user-error when the `classpath' op is not supported."
4949
(spy-on 'cider-ensure-op-supported :and-return-value nil)
50-
(expect (lambda () (cider-open-classpath-entry)) :to-throw 'user-error)))
50+
(expect (cider-open-classpath-entry) :to-throw 'user-error)))

test/cider-client-tests.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,15 +438,15 @@
438438
(expect (cider-ensure-connected) :to-equal nil))
439439
(it "raises a user-error in the absence of a connection"
440440
(spy-on 'cider-connected-p :and-return-value nil)
441-
(expect (lambda () (cider-ensure-connected)) :to-throw 'user-error)))
441+
(expect (cider-ensure-connected) :to-throw 'user-error)))
442442

443443
(describe "cider-ensure-op-supported"
444444
(it "returns nil when the op is supported"
445445
(spy-on 'cider-nrepl-op-supported-p :and-return-value t)
446446
(expect (cider-ensure-op-supported "foo") :to-equal nil))
447447
(it "raises a user-error if the op is not supported"
448448
(spy-on 'cider-nrepl-op-supported-p :and-return-value nil)
449-
(expect (lambda () (cider-ensure-op-supported "foo"))
449+
(expect (cider-ensure-op-supported "foo")
450450
:to-throw 'user-error)))
451451

452452
(describe "cider-expected-ns"

test/cider-interaction-tests.el

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,47 +58,47 @@
5858
(describe "cider-refresh"
5959
(it "raises a user error if cider is not connected"
6060
(spy-on 'cider-connected-p :and-return-value nil)
61-
(expect (lambda () (cider-refresh)) :to-throw 'user-error)))
61+
(expect (cider-refresh) :to-throw 'user-error)))
6262

6363
(describe "cider-quit"
6464
(it "raises a user error if cider is not connected"
6565
(spy-on 'cider-connected-p :and-return-value nil)
66-
(expect (lambda () (cider-quit)) :to-throw 'user-error)))
66+
(expect (cider-quit) :to-throw 'user-error)))
6767

6868
(describe "cider-restart"
6969
(it "raises a user error if cider is not connected"
7070
(spy-on 'cider-connected-p :and-return-value nil)
71-
(expect (lambda () (cider-restart)) :to-throw 'user-error)))
71+
(expect (cider-restart) :to-throw 'user-error)))
7272

7373
(describe "cider-find-ns"
7474
(it "raises a user error if cider is not connected"
7575
(spy-on 'cider-connected-p :and-return-value nil)
76-
(expect (lambda () (cider-find-ns)) :to-throw 'user-error))
76+
(expect (cider-find-ns) :to-throw 'user-error))
7777
(it "raises a user error if the op is not supported"
7878
(spy-on 'cider-nrepl-op-supported-p :and-return-value nil)
79-
(expect (lambda () (cider-find-ns)) :to-throw 'user-error)))
79+
(expect (cider-find-ns) :to-throw 'user-error)))
8080

8181
(describe "cider-load-all-project-ns"
8282
(it "raises a user error if cider is not connected"
8383
(spy-on 'cider-connected-p :and-return-value nil)
84-
(expect (lambda () (cider-load-all-project-ns)) :to-throw 'user-error))
84+
(expect (cider-load-all-project-ns) :to-throw 'user-error))
8585
(it "raises a user error if the op is not supported"
8686
(spy-on 'cider-nrepl-op-supported-p :and-return-value nil)
87-
(expect (lambda () (cider-load-all-project-ns)) :to-throw 'user-error)))
87+
(expect (cider-load-all-project-ns) :to-throw 'user-error)))
8888

8989
(describe "cider-load-file"
90-
(it "works as expected in empty Clojure buffers"
91-
(spy-on 'cider-request:load-file :and-return-value nil)
92-
(with-connection-buffer "clj" b
93-
(with-temp-buffer
94-
(clojure-mode)
95-
(setq buffer-file-name (make-temp-name "tmp.clj"))
96-
(expect (lambda () (cider-load-buffer)) :not :to-throw)))))
90+
(it "works as expected in empty Clojure buffers"
91+
(spy-on 'cider-request:load-file :and-return-value nil)
92+
(with-connection-buffer "clj" b
93+
(with-temp-buffer
94+
(clojure-mode)
95+
(setq buffer-file-name (make-temp-name "tmp.clj"))
96+
(expect (cider-load-buffer) :not :to-throw)))))
9797

9898
(describe "cider-interactive-eval"
99-
(it "works as expected in empty Clojure buffers"
100-
(spy-on 'cider-nrepl-request:eval :and-return-value nil)
101-
(with-connection-buffer "clj" b
102-
(with-temp-buffer
103-
(clojure-mode)
104-
(expect (lambda () (cider-interactive-eval "(+ 1)")) :not :to-throw)))))
99+
(it "works as expected in empty Clojure buffers"
100+
(spy-on 'cider-nrepl-request:eval :and-return-value nil)
101+
(with-connection-buffer "clj" b
102+
(with-temp-buffer
103+
(clojure-mode)
104+
(expect (cider-interactive-eval "(+ 1)") :not :to-throw)))))

0 commit comments

Comments
 (0)