summaryrefslogtreecommitdiff
path: root/test/cider-apropos-tests.el
diff options
context:
space:
mode:
authorChaitanya Koparkar <ckoparkar@live.in>2016-04-13 12:33:13 +0530
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2016-04-13 00:03:13 -0700
commit8827eb1e4b23c2f0630a977c11e61dd0ffa492b2 (patch)
tree0c8ddf31f6bf47fdcd4596bf95819b5607262890 /test/cider-apropos-tests.el
parent19d78fecb55b6462c20ba598ddd04ac13fd7e0e3 (diff)
[#1650] Start writing tests using buttercup (#1659)
Diffstat (limited to 'test/cider-apropos-tests.el')
-rw-r--r--test/cider-apropos-tests.el29
1 files changed, 15 insertions, 14 deletions
diff --git a/test/cider-apropos-tests.el b/test/cider-apropos-tests.el
index 9a61f97f..6c8b4e57 100644
--- a/test/cider-apropos-tests.el
+++ b/test/cider-apropos-tests.el
@@ -1,20 +1,21 @@
-(require 'ert)
-(require 'noflet)
+(require 'buttercup)
(require 'cider)
(require 'cider-apropos)
-(ert-deftest cider-apropos-not-connected ()
- (noflet ((cider-connected-p () nil))
- (should-error (cider-apropos "test") :type 'user-error)))
+(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))
-(ert-deftest cider-apropos-unsupported-op ()
- (noflet ((cider-ensure-op-supported (op) nil))
- (should-error (cider-apropos "test") :type '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)))
-(ert-deftest cider-apropos-documentation-not-connected ()
- (noflet ((cider-connected-p () nil))
- (should-error (cider-apropos-documentation) :type '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))
-(ert-deftest cider-apropos-documentation-unsupported-op ()
- (noflet ((cider-ensure-op-supported (op) nil))
- (should-error (cider-apropos-documentation) :type '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)))