Fix: tests also use YAS--WITH-TEMPORARY-REDEFINITIONS to make stubs

This commit is contained in:
João Távora 2012-12-24 01:35:05 +00:00
parent 1ef0091de1
commit e5c41c78d2

View File

@ -260,11 +260,12 @@ TODO: correct this bug!"
(defmacro yas-with-overriden-buffer-list (&rest body)
(let ((saved-sym (gensym)))
`(let ((,saved-sym (symbol-function 'buffer-list)))
(cl-flet ((buffer-list ()
(remove-if #'(lambda (buf)
(with-current-buffer buf
(eq major-mode 'lisp-interaction-mode)))
(funcall ,saved-sym))))
(yas--with-temporary-redefinitions
((buffer-list ()
(remove-if #'(lambda (buf)
(with-current-buffer buf
(eq major-mode 'lisp-interaction-mode)))
(funcall ,saved-sym))))
,@body))))
(defmacro yas-with-some-interesting-snippet-dirs (&rest body)
@ -474,9 +475,10 @@ TODO: be meaner"
(defun yas/ert ()
(interactive)
(with-temp-buffer
(cl-flet ((message (&rest args) ;
(declare (ignore args))
nil))
(yas--with-temporary-redefinitions
((message (&rest args) ;
(declare (ignore args))
nil))
(ert t (buffer-name (current-buffer)))
(princ (buffer-string)))))