File size: 718 Bytes
43203b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(in-package :cl-user)
(defpackage clack-errors-test
  (:use :cl :fiveam)
  (:export :run-tests))
(in-package :clack-errors-test)

(def-suite tests
  :description "clack-errors tests")
(in-suite tests)

(defun request-code (url)
  (nth-value 1
             (drakma:http-request (concatenate 'string
                                               "http://localhost:8000"
                                               url))))

(test start-app
  (finishes
   (clack-errors-test.app:start)))

(test routes
  (is
   (equal (request-code "/no-error")
          200))
  (is
   (equal (request-code "/error")
          500)))

(test stop-app
  (finishes
   (clack-errors-test.app:stop)))

(defun run-tests ()
  (run! 'tests))