From 0b2218706d21bf0ac18b66ef2cf5ea2cbf574171 Mon Sep 17 00:00:00 2001 From: Bruno Heridet Date: Mon, 15 Jul 2024 19:20:18 +0200 Subject: [PATCH] (test): add org-roam-buffer-p (#2461) --- tests/test-org-roam.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test-org-roam.el b/tests/test-org-roam.el index 92c236c..5e164da 100644 --- a/tests/test-org-roam.el +++ b/tests/test-org-roam.el @@ -24,6 +24,8 @@ (require 'buttercup) (require 'org-roam) +(defvar root-directory default-directory) + (describe "org-roam-file-p" (it "checks if given file respects criteria" (expect (org-roam-file-p "tests/roam-files/family.org") :to-equal nil) @@ -35,6 +37,14 @@ (setq org-roam-file-exclude-regexp (regexp-quote "family.org")) (expect (org-roam-file-p "tests/roam-files/family.org") :to-equal nil))) +(describe "org-roam-buffer-p" + (it "checks if current buffer respects criteria" + (setq org-roam-directory (expand-file-name "tests/roam-files") + org-roam-file-exclude-regexp nil) + (find-file "tests/roam-files/family.org" nil) + (expect (org-roam-buffer-p) :to-equal t) + (cd root-directory))) + (describe "org-roam-list-files" (before-each (setq org-roam-directory (expand-file-name "tests/roam-files")