aboutsummaryrefslogtreecommitdiff
path: root/test/unit-test.el
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2017-12-10 20:32:43 +0000
committerWilfred Hughes <me@wilfred.me.uk>2017-12-10 20:32:56 +0000
commit967dc742f866005da2e61fbd548bfdbf32d788fe (patch)
treeace4ccff2f15f6dcde9dc00786946214d02849f7 /test/unit-test.el
parentdae62eed7d7abfaaaf1746ced458d428b724d702 (diff)
Only try to kill the buffer we've created
If buf (the buffer containing the symbol definition) is nil, we end up killing the current buffer. The current buffer is the buffer that we're trying to write into. Fixes #58
Diffstat (limited to 'test/unit-test.el')
-rw-r--r--test/unit-test.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit-test.el b/test/unit-test.el
index cf50f35..a0641e0 100644
--- a/test/unit-test.el
+++ b/test/unit-test.el
@@ -40,10 +40,12 @@
"We should not crash on a function without a docstring."
(should (null (helpful--docstring #'test-foo-no-docstring t))))
-(ert-deftest helpful--interacively-defined-fn ()
+(ert-deftest helpful--interactively-defined-fn ()
"We should not crash on a function without source code."
(eval '(defun test-foo-defined-interactively () 42))
- (helpful-function #'test-foo-defined-interactively))
+ (with-temp-buffer
+ (helpful-function #'test-foo-defined-interactively)
+ (should (equal (buffer-name) "*helpful function: test-foo-defined-interactively*"))))
(defun test-foo-usage-docstring ()
"\n\n(fn &rest ARGS)"