diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-15 23:48:20 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-15 23:48:20 -0500 |
| commit | f33315dafdf30e9bd5727b77a0af8797e9d0ea76 (patch) | |
| tree | e9d0d1f6d56db642a94ee16cc06681a0528afbeb /tests | |
| parent | 07e8749b80d420fb53cd25d08a76733c04e05a01 (diff) | |
| download | dotemacs-f33315dafdf30e9bd5727b77a0af8797e9d0ea76.tar.gz dotemacs-f33315dafdf30e9bd5727b77a0af8797e9d0ea76.zip | |
fix(ai-config): Ensure gptel-magit is installed via use-package
Replace raw autoload calls with a `use-package` declaration so
`use-package-always-ensure` installs gptel-magit on machines that
haven't run `package-install`, fixing the "Cannot open load file"
error on transient setup.
Diffstat (limited to 'tests')
| -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 |
