Permalink
Browse files

FIXTURES: Gone!

  • Loading branch information...
1 parent e96b0f1 commit d8b9e6caadfeab53691ec3aef9d04eac6098e336 @adlai committed Dec 20, 2009
Showing with 2 additions and 51 deletions.
  1. +0 −1 eos.asd
  2. +0 −38 src/fixture.lisp
  3. +1 −7 src/package.lisp
  4. +1 −5 tests/tests.lisp
View
1 eos.asd
@@ -9,7 +9,6 @@
(:file "utils" :depends-on ("package"))
(:file "classes" :depends-on ("package"))
(:file "check" :depends-on ("utils"))
- (:file "fixture" :depends-on ("package"))
(:file "random" :depends-on ("check"))
(:file "test" :depends-on ("classes"))
(:file "explain" :depends-on ("classes" "check"))
View
38 src/fixture.lisp
@@ -1,38 +0,0 @@
-;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
-
-(in-package :Eos)
-
-(defvar *fixture* (make-hash-table)
- "Table mapping fixture names to fixture objects.")
-
-(defun get-fixture (key &optional default)
- (gethash key *fixture* default))
-
-(defun (setf get-fixture) (value key)
- (when (gethash key *fixture*)
- (warn "Redefining fixture ~a" key))
- (setf (gethash key *fixture*) value))
-
-(defun rem-fixture (key)
- (remhash key *fixture*))
-
-(defmacro def-fixture (name args &body body)
- "Defines a fixture named NAME. A fixture is very much like a
-macro but is used only for simple templating. A fixture created
-with DEF-FIXTURE is a macro which can use the special macrolet
-&BODY to specify where the body should go.
-
-See Also: `with-fixture'."
- `(eval-when (:compile-toplevel :load-toplevel :execute)
- (setf (get-fixture ',name) (cons ',args ',body))
- ',name))
-
-(defmacro with-fixture (fixture-name args &body body)
- "Insert BODY into the fixture named FIXTURE-NAME.
-
-See Also: `def-fixture'."
- (assert (get-fixture fixture-name) (fixture-name)
- "Unknown fixture ~S." fixture-name)
- (destructuring-bind (largs &rest lbody) (get-fixture fixture-name)
- `(macrolet ((&body () '(progn ,@body)))
- (funcall (lambda ,largs ,@lbody) ,@args))))
View
8 src/package.lisp
@@ -12,12 +12,6 @@
#:get-test
#:rem-test
#:test-names
- ;; fixtures
- #:make-fixture
- #:def-fixture
- #:with-fixture
- #:get-fixture
- #:rem-fixture
;; running checks
#:is
#:is-every
@@ -54,4 +48,4 @@
#:*verbose-failures*
#:results-status))
-(pushnew :Eos *features*)
+(pushnew :Eos *features*)
View
6 tests/tests.lisp
@@ -10,10 +10,6 @@
`(let ((,results (with-*test-dribble* nil (run ',test-name))))
,@body))
-(rem-fixture 'null-fixture)
-(def-fixture null-fixture ()
- `(progn ,@(&body)))
-
;;;; Test the checks
(test (is1 :suite test-suite)
@@ -24,7 +20,7 @@
(is-true t)
(is-false nil))
-(test (is2 :suite test-suite :fixture null-fixture)
+(test (is2 :suite test-suite)
(is (plusp 0))
(is (< 0 -1))
(is (not (plusp 1)))

0 comments on commit d8b9e6c

Please sign in to comment.