diff options
-rw-r--r-- | test/tests.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/tests.el b/test/tests.el index 9e1cff1..e097244 100644 --- a/test/tests.el +++ b/test/tests.el @@ -8,14 +8,13 @@ ;;; Tests (defun stack-test-sample-data (method &optional directory) - (with-current-buffer - (find-file-noselect - (concat "data-samples/" - (when directory (concat directory "/")) - method ".el")) - (eval (read (if (string-equal "" (buffer-string)) - "'no-value" - (buffer-string)))))) + (let ((file (concat "data-samples/" + (when directory (concat directory "/")) + method ".el"))) + (when (file-exists-p file) + (with-temp-buffer + (insert-file-contents file) + (read (buffer-string)))))) (setq stack-core-remaining-api-requests-message-threshold 50000 |