diff options
Diffstat (limited to 'tests/test-ai-config-gptel-magit-lazy-loading.el')
| -rw-r--r-- | tests/test-ai-config-gptel-magit-lazy-loading.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test-ai-config-gptel-magit-lazy-loading.el b/tests/test-ai-config-gptel-magit-lazy-loading.el index 05e3634d..bc345ef0 100644 --- a/tests/test-ai-config-gptel-magit-lazy-loading.el +++ b/tests/test-ai-config-gptel-magit-lazy-loading.el @@ -123,5 +123,21 @@ a gptel-magit function is called." One for magit-commit (generate) and one for magit-diff (explain)." (should (= 2 (length test-gptel-magit--transient-calls)))) +;;; Error Cases — Install behavior + +(ert-deftest test-ai-config-gptel-magit-declared-via-use-package () + "ai-config should declare gptel-magit via `use-package' so it gets installed. +Raw `(autoload ...)' calls register the function name but leave the +package uninstalled on machines that never ran `package-install'. The +\\=`use-package' form inherits `use-package-always-ensure' from +early-init, which is how every other package in this config gets +onto `load-path' before its autoloads fire." + (let ((source-file (expand-file-name "modules/ai-config.el" + user-emacs-directory))) + (with-temp-buffer + (insert-file-contents source-file) + (goto-char (point-min)) + (should (re-search-forward "(use-package gptel-magit\\b" nil t))))) + (provide 'test-ai-config-gptel-magit-lazy-loading) ;;; test-ai-config-gptel-magit-lazy-loading.el ends here |
