adjust tests so they don't leave detritus

pull/131/head
Matthew Butterick 8 years ago
parent 859aa44105
commit 186111b5ca

@ -1 +1 @@
1476035093
1476227076

@ -6,3 +6,8 @@
(define items (make-default-tag-function 'ul))
(define item (make-default-tag-function 'li 'p))
(define (link url text) `(a [[href ,url]] ,text))
(module setup racket/base
(provide (all-defined-out))
(define compile-cache-active #f)
(define render-cache-active #f))

@ -0,0 +1,8 @@
#lang racket/base
;; This will prevent tests from littering their directory
;; with pollen-cache files.
(module setup racket/base
(provide (all-defined-out))
(define compile-cache-active #f)
(define render-cache-active #f))

@ -9,8 +9,9 @@
(define-runtime-path cache-dir "data/pathup/subdir/pollen-cache")
(define-runtime-path other-cache-dir "data/pathup/subdir/subdir/pollen-cache")
(check-false (get-directory-require-files "test-pathup.rkt"))
(define-runtime-path up-pollen "pollen.rkt")
(check-equal? (get-directory-require-files "test-pathup.rkt") (list up-pollen))
(check-equal? (get-directory-require-files pathup-one) (list dr-top))
(check-equal? (get-directory-require-files pathup-two) (list dr-sub))
(check-equal? (get-template-for pathup-one) template)

@ -13,10 +13,6 @@
(define-runtime-path downtown.html "data/quick-tour/downtown/downtown.html")
(define-runtime-path uptown.html "data/quick-tour/uptown/uptown.html")
(define-runtime-path pollen-cache "data/quick-tour/pollen-cache")
(define-runtime-path pollen-cache-uptown "data/quick-tour/uptown/pollen-cache")
(define-runtime-path pollen-cache-downtown "data/quick-tour/downtown/pollen-cache")
;; test makes sure that quick tour files work
(parameterize ([current-output-port (open-output-string)]
[current-directory quick-tour-dir]
@ -30,5 +26,4 @@
(check-true (file-exists? downtown.html))
(check-true (file-exists? uptown.html)))
(for-each delete-file (list hello.txt margin.html downtown.html uptown.html))
(for-each delete-directory/files (list pollen-cache pollen-cache-uptown pollen-cache-downtown))
(for-each delete-file (list hello.txt margin.html downtown.html uptown.html))
Loading…
Cancel
Save