From 7a58be5e2a0aeae2e170cc576befbb3a2e34878e Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Sun, 2 Nov 2014 13:23:28 -0500 Subject: Fix get-sample-data and avoid `find-file-noselect' --- test/tests.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'test') 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 -- cgit v1.2.3