summaryrefslogtreecommitdiff
path: root/test/cider-apropos-tests.el
blob: 6c8b4e57f30a16692dc36227d3b287db6f3946f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(require 'buttercup)
(require 'cider)
(require 'cider-apropos)

(describe "cider-apropos"
  (it "raises user-error when cider is not connected."
    (spy-on 'cider-connected-p :and-return-value nil)
    (expect (lambda () (cider-apropos "test")) :to-throw 'user-error))

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

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

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