diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-14 02:35:00 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-14 02:35:00 -0600 |
| commit | b7806c89885ba2878b6dd9a2c1ed730882273362 (patch) | |
| tree | 79be5ffb5a5c816a3bc1a8550aa1ddef4ce6c54e /tests/test-video-audio-recording-check-ffmpeg.el | |
| parent | 94d4e6c9624046cef20236a8073a4857d3bd7827 (diff) | |
| download | dotemacs-b7806c89885ba2878b6dd9a2c1ed730882273362.tar.gz dotemacs-b7806c89885ba2878b6dd9a2c1ed730882273362.zip | |
Revert "checking in modified/removed tests and other misc changes"
This reverts commit 94d4e6c9624046cef20236a8073a4857d3bd7827.
Diffstat (limited to 'tests/test-video-audio-recording-check-ffmpeg.el')
| -rw-r--r-- | tests/test-video-audio-recording-check-ffmpeg.el | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/test-video-audio-recording-check-ffmpeg.el b/tests/test-video-audio-recording-check-ffmpeg.el new file mode 100644 index 00000000..5c264b64 --- /dev/null +++ b/tests/test-video-audio-recording-check-ffmpeg.el @@ -0,0 +1,46 @@ +;;; test-video-audio-recording-check-ffmpeg.el --- Tests for cj/recording-check-ffmpeg -*- lexical-binding: t; -*- + +;;; Commentary: +;; Unit tests for cj/recording-check-ffmpeg function. +;; Tests detection of ffmpeg availability. + +;;; Code: + +(require 'ert) + +;; Stub dependencies before loading the module +(defvar cj/custom-keymap (make-sparse-keymap) + "Stub keymap for testing.") + +;; Now load the actual production module +(require 'video-audio-recording) + +;;; Normal Cases + +(ert-deftest test-video-audio-recording-check-ffmpeg-normal-ffmpeg-found-returns-t () + "Test that function returns t when ffmpeg is found." + (cl-letf (((symbol-function 'executable-find) + (lambda (cmd) + (when (equal cmd "ffmpeg") "/usr/bin/ffmpeg")))) + (let ((result (cj/recording-check-ffmpeg))) + (should (eq t result))))) + +;;; Error Cases + +(ert-deftest test-video-audio-recording-check-ffmpeg-error-ffmpeg-not-found-signals-error () + "Test that function signals user-error when ffmpeg is not found." + (cl-letf (((symbol-function 'executable-find) + (lambda (_cmd) nil))) + (should-error (cj/recording-check-ffmpeg) :type 'user-error))) + +(ert-deftest test-video-audio-recording-check-ffmpeg-error-message-mentions-pacman () + "Test that error message includes installation command." + (cl-letf (((symbol-function 'executable-find) + (lambda (_cmd) nil))) + (condition-case err + (cj/recording-check-ffmpeg) + (user-error + (should (string-match-p "pacman -S ffmpeg" (error-message-string err))))))) + +(provide 'test-video-audio-recording-check-ffmpeg) +;;; test-video-audio-recording-check-ffmpeg.el ends here |
