Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created June 20, 2013 15:45
Show Gist options
  • Save PuercoPop/5823936 to your computer and use it in GitHub Desktop.
Save PuercoPop/5823936 to your computer and use it in GitHub Desktop.
(defun test-collector ()
"Looks for all the triplets and defines a test for them. In current suite or
taking a suite as an argument? "
(loop
for triplet in (setup-test-tuples
(merge-pathnames "requests/valid/*.http" *specs-dir*))
do
(let ((http-file (first triplet))
(request-file (second triplet))
(spec-file (third triplet)))
`(test ,(gensym) ()
(let* ((http-stream (open http-file))
(expected-request (read (open request-file)))
(request-tests (read (open spec-file))))
(close http-stream)
(eval request-tests))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment