1 ;; -*- mode: lisp; syntax: common-lisp; coding: utf-8-unix; package: cl-mock; -*-
5 ;;; syntactic sugar for defining the mock interactions
7 (defun true (&rest arguments)
8 (declare (ignore arguments))
11 (defmacro answer (call &body forms)
12 (let ((name (if (listp call) (car call) call))
16 (let ((,sym (fdefinition ',name)))
17 (declare (ignorable ,sym))
20 (declare (ignorable args))
22 `(case (prog1 times (incf times))
25 for (form . rest) on forms
26 collect `(,(if rest i T) ,form)))))
29 ((list . ,(cdr call)) ,cases)