summaryrefslogtreecommitdiff
path: root/test/lisp/use-package/use-package-tests.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2020-06-18 11:04:04 -0700
committerGitHub <noreply@github.com>2020-06-18 11:04:04 -0700
commit4e72885f852604dc17c5bd543dc6cb88c44cf2f1 (patch)
tree8260e86eed475b85670245e83196fb4809dc8966 /test/lisp/use-package/use-package-tests.el
parent218687d8979b1d6e2d5caee636372725a74ba0d9 (diff)
parent203d15e34e99ac6bbe05bd10b2e849bd98d78d31 (diff)
downloademacs-4e72885f852604dc17c5bd543dc6cb88c44cf2f1.tar.gz
emacs-4e72885f852604dc17c5bd543dc6cb88c44cf2f1.tar.bz2
emacs-4e72885f852604dc17c5bd543dc6cb88c44cf2f1.zip
Merge pull request from jjlee/call-hooks-even-if-no-config
GitHub-reference: https://github.com/jwiegley/use-package/issues/840
Diffstat (limited to 'test/lisp/use-package/use-package-tests.el')
-rw-r--r--test/lisp/use-package/use-package-tests.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el
index 04a653e30e8..61438185373 100644
--- a/test/lisp/use-package/use-package-tests.el
+++ b/test/lisp/use-package/use-package-tests.el
@@ -1474,6 +1474,37 @@
(config)
t))))))
+(ert-deftest use-package-test/pre-post-hooks-with-:config ()
+ (let ((use-package-inject-hooks t))
+ (match-expansion
+ (use-package foo :config (config))
+ `(progn
+ (when
+ (run-hook-with-args-until-failure 'use-package--foo--pre-init-hook)
+ (run-hooks 'use-package--foo--post-init-hook))
+ (require 'foo nil nil)
+ (when
+ (run-hook-with-args-until-failure 'use-package--foo--pre-config-hook)
+ (config)
+ (run-hooks 'use-package--foo--post-config-hook))
+ t))))
+
+(ert-deftest use-package-test/pre-post-hooks-without-:config ()
+ ;; https://github.com/jwiegley/use-package/issues/785
+ (let ((use-package-inject-hooks t))
+ (match-expansion
+ (use-package foo)
+ `(progn
+ (when
+ (run-hook-with-args-until-failure 'use-package--foo--pre-init-hook)
+ (run-hooks 'use-package--foo--post-init-hook))
+ (require 'foo nil nil)
+ (when
+ (run-hook-with-args-until-failure 'use-package--foo--pre-config-hook)
+ t
+ (run-hooks 'use-package--foo--post-config-hook))
+ t))))
+
(ert-deftest use-package-test-normalize/:diminish ()
(should (equal (use-package-normalize-diminish 'foopkg :diminish nil)
'(foopkg-mode)))