summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJon Pither <jon.pither@gmail.com>2013-08-11 14:34:35 +0100
committerJon Pither <jon.pither@gmail.com>2013-08-14 09:30:45 +0100
commit7b9e6ca5f71da4821e6a83b65e30d69091ad75ce (patch)
treeee24e907d0dc8381a11cd62c4a28e63ed1cd963f /test
parentf7b9007ed97ec3bc264268327ee59fb864ec44ef (diff)
clojure buffer name uses project name
Diffstat (limited to 'test')
-rw-r--r--test/nrepl-tests.el39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/nrepl-tests.el b/test/nrepl-tests.el
index 67b821f6..8a632652 100644
--- a/test/nrepl-tests.el
+++ b/test/nrepl-tests.el
@@ -349,3 +349,42 @@
(should (not (equal (current-buffer) b1)))
(nrepl-invoke-selector-method-by-key ?v)
(should (equal (current-buffer) b1))))))
+
+(ert-deftest test-nrepl-clojure-buffer-name ()
+ (with-temp-buffer
+ (lexical-let ((b1 (current-buffer)))
+ (let ((nrepl-connection-list (list (buffer-name b1))))
+ (should
+ (equal (nrepl-repl-buffer-name) "*nrepl*"))))))
+
+(ert-deftest test-nrepl-clojure-buffer-name-based-on-project ()
+ (with-temp-buffer
+ (lexical-let ((b1 (current-buffer)))
+ (set (make-local-variable 'nrepl-project-dir) "proj")
+ (let ((nrepl-connection-list (list (buffer-name b1))))
+ (should
+ (equal (nrepl-repl-buffer-name) "*nrepl proj*"))))))
+
+(ert-deftest test-nrepl-clojure-buffer-name-separator ()
+ (with-temp-buffer
+ (lexical-let ((b1 (current-buffer)))
+ (set (make-local-variable 'nrepl-project-dir) "proj")
+ (let ((nrepl-connection-list (list (buffer-name b1)))
+ (nrepl-buffer-name-separator "X"))
+ (should
+ (equal (nrepl-repl-buffer-name) "*nreplXproj*"))))))
+
+(ert-deftest test-nrepl-clojure-buffer-name-two-buffers-same-project ()
+ (with-temp-buffer
+ (set (make-local-variable 'nrepl-project-dir) "proj")
+ (let* ((nrepl-connection-list (list (buffer-name (current-buffer))))
+ (nrepl-new-buffer (nrepl-repl-buffer-name)))
+ (get-buffer-create nrepl-new-buffer)
+ (should
+ (equal nrepl-new-buffer "*nrepl proj*"))
+ (with-temp-buffer
+ (set (make-local-variable 'nrepl-project-dir) "proj")
+ (let ((nrepl-connection-list (list (buffer-name (current-buffer)))))
+ (should
+ (equal (nrepl-repl-buffer-name) "*nrepl proj*<2>")))
+ (kill-buffer nrepl-new-buffer)))))