chickadee » server-test » with-test-server

with-test-server server-thunk tests-thunkprocedure

Start the server by executing server-thunk, run the tests (tests-thunk) and stop the server.

Here's a usage example with the awful, test and http-client eggs:

The awful application to be tested:

(use awful)

(define-page "/foo"
  (lambda ()
  no-template: #t)

The test program:

(use server-test awful http-client test)

;; The awful application to be tested
(awful-apps (list "foo.scm"))

 (lambda ()
    (lambda ()
      (load-apps (awful-apps)))))
 (lambda ()   
   (test "foo"
         (with-input-from-request "http://localhost:8080/foo"