Created
March 6, 2019 18:36
-
-
Save ageldama/cc11a2b4a6d2161a2e4c08fa309ce547 to your computer and use it in GitHub Desktop.
cl-mock + prove hello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (eval-when (:compile-toplevel :load-toplevel :execute) | |
| (ql:quickload :cl-mock) | |
| (ql:quickload :prove)) | |
| (defpackage cl-mock-hello | |
| (:use :cl :cl-mock :prove) | |
| (:export :run)) | |
| (in-package :cl-mock-hello) | |
| (defun foo (a b) | |
| (format nil "A=~a B=~a" a b)) | |
| (defun run () | |
| (foo :spam :eggs)) | |
| (setq prove:*default-reporter* :fiveam) | |
| (plan 1) | |
| (is (with-mocks () | |
| (prog2 | |
| (answer foo 42) | |
| (run) | |
| (equal (invocations 'foo) | |
| '((foo :spam :eggs))))) | |
| 42) | |
| (finalize) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment