branch: elpa/buttercup commit 76774d3959b18f5dbd3764ad34e0ee27fcd281ae Author: Ola Nilsson <ola.nils...@gmail.com> Commit: Ola Nilsson <ola.nils...@gmail.com>
test: Remove the dependency on autoload.el Update the "can spy on autoloaded functions" test to use `autoload` directly instead of `make-autoload'. Fixes #233. --- tests/test-buttercup.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el index 5ebbe0265d..3a99fede1e 100644 --- a/tests/test-buttercup.el +++ b/tests/test-buttercup.el @@ -25,7 +25,6 @@ ;;; Code: (require 'buttercup) -(require 'autoload) (require 'ansi-color) (require 'bytecomp) (require 'ert) @@ -1364,8 +1363,7 @@ before it's processed by other functions." (function-name 'test-autoloaded-function) (defun-form `(defun ,function-name () "An autoloaded function" - :loaded-successfully)) - (autoload-form (make-autoload defun-form function-file))) + :loaded-successfully))) (unwind-protect (progn ;; Create the real function in a file @@ -1374,12 +1372,14 @@ before it's processed by other functions." (pp-to-string defun-form))) ;; Define the autoload for the function (fmakunbound function-name) - (eval autoload-form) + (autoload function-name function-file "An autoloaded function") (expect (autoloadp (symbol-function function-name))) (spy-on function-name :and-call-through) (expect (not (autoloadp (symbol-function function-name)))) (expect (funcall function-name) - :to-be :loaded-successfully)) + :to-be :loaded-successfully) + (expect function-name :to-have-been-called)) + (fmakunbound function-name) (delete-file function-file nil)))) (it "can spy on non-existing functions"