aboutsummaryrefslogtreecommitdiff
path: root/test/tests.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-02 13:23:28 -0500
committerSean Allred <code@seanallred.com>2014-11-02 13:23:28 -0500
commit7a58be5e2a0aeae2e170cc576befbb3a2e34878e (patch)
tree89b47f4976484035961a8a28305f0b5bfa2557ee /test/tests.el
parentf349fe5d764730a0a339045a59a46d53b9a33100 (diff)
Fix get-sample-data and avoid `find-file-noselect'
Diffstat (limited to 'test/tests.el')
-rw-r--r--test/tests.el15
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