(defpackage clack-test.sample
(:use :cl
:clack.test
:cl-test-more
:drakma))
(in-package :clack-test.sample)
(test-app
(lambda (env)
(declare (ignore env))
`(200 (:content-type "text/plain") ("Hello, Clack!")))
(lambda ()
(multiple-value-bind (body status headers)
(http-request "http://localhost:4242")
(is status 200)
(is body "Hello, Clack!")
(is (assoc :content-type headers) "text/plain")))
"Testing simple application") Clack.Test provides simple interface to test Clack Application or Middleware.
Your Lisp have to support multi-thread to run this.
Eitarow Fukamachi (e.arrows@gmail.com)
Test Clack Application.
Define tests for Clack Application. This just wrap `cl-test-more:deftest`, so you can run this test by calling `(cl-test-more:run-test :foo)`.