diff options
author | Sean Allred <code@seanallred.com> | 2014-11-02 13:23:28 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-02 13:23:28 -0500 |
commit | 7a58be5e2a0aeae2e170cc576befbb3a2e34878e (patch) | |
tree | 89b47f4976484035961a8a28305f0b5bfa2557ee /test/tests.el | |
parent | f349fe5d764730a0a339045a59a46d53b9a33100 (diff) |
Fix get-sample-data and avoid `find-file-noselect'
Diffstat (limited to 'test/tests.el')
-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 |