aboutsummaryrefslogtreecommitdiff
path: root/tests.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-10-31 00:42:26 -0400
committerSean Allred <code@seanallred.com>2014-10-31 00:42:26 -0400
commit3dbca261e2a0fc392ab0cc2e63c9d0c2d948bcf1 (patch)
treed92aac4eae5cadfb8b59273be93349e342c7c7ac /tests.el
parent1838aeb531ab61e2c333c70fbf57d534df54fc47 (diff)
Implement proper unit tests
Diffstat (limited to 'tests.el')
-rw-r--r--tests.el25
1 files changed, 12 insertions, 13 deletions
diff --git a/tests.el b/tests.el
index bf9b94e..24caedb 100644
--- a/tests.el
+++ b/tests.el
@@ -1,3 +1,10 @@
+(defun -stack--nuke ()
+ (interactive)
+ (mapatoms
+ (lambda (symbol)
+ (if (string-prefix-p "stack-" (symbol-name symbol))
+ (unintern symbol)))))
+
;;; Tests
(add-to-list 'load-path ".")
@@ -5,17 +12,9 @@
(require 'stack-core)
(require 'stack-question)
-(setq
- stack-tmp (stack-question-get-questions 'emacs)
- stack-tmp-2 (stack-question-get-questions 'emacs 2))
+(ert-deftest test-question-retrieve ()
+ (should (stack-question-get-questions 'emacs)))
-(prog1 nil
- (stack-message "%S" stack-tmp)
- (stack-message "%S" stack-tmp-2))
-
-(defun -stack--nuke ()
- (interactive)
- (mapatoms
- (lambda (symbol)
- (if (string-prefix-p "stack-" (symbol-name symbol))
- (unintern symbol)))))
+(ert-deftest test-bad-request ()
+ (should-error
+ (stack-core-make-request "questions" '(()))))