emacs-ipython-notebook/tests/test-ein-shared-output.el
Takafumi Arakaki 0fad9548cd Merge branch 'worksheet'
Conflicts:
	tests/test-ein-shared-output.el

Add worksheet module to start worksheet support.  There is no
multiple worksheet support yet.  I am merging this since this
branch is as usable as the master branch.

Also, there are several bug fixes and improvements unrelated to
worksheet feature.
2012-08-23 22:48:17 +02:00

28 lines
1,005 B
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(require 'ein-shared-output)
(defmacro eintest:shared-output-with-buffer (&rest body)
(declare (indent 0))
`(with-current-buffer (ein:shared-output-create-buffer)
(ein:shared-output-get-or-create)
,@body))
(defmacro eintest:shared-output-is-empty-context-of (func)
`(ert-deftest ,(intern (format "%s--shared-output" func)) ()
(eintest:shared-output-with-buffer
(should-not (,func)))))
;; Generic getter
(ert-deftest ein:get-cell-at-point--shared-output ()
(eintest:shared-output-with-buffer
(should (eq (ein:get-cell-at-point)
(ein:shared-output-get-cell))))
(with-temp-buffer
(should-not (ein:get-cell-at-point--shared-output))))
;; FIXME: Add tests with non-empty shared output buffer.
(eintest:shared-output-is-empty-context-of ein:get-url-or-port)
(eintest:shared-output-is-empty-context-of ein:get-notebook)
(eintest:shared-output-is-empty-context-of ein:get-kernel)
(eintest:shared-output-is-empty-context-of ein:get-traceback-data)