Skip to content

Commit 2d60b56

Browse files
vemvbbatsov
authored andcommitted
Tests: handle .nrepl-port files with newlines in them
1 parent 2094051 commit 2d60b56

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/refactor_nrepl/client.clj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
(ns refactor-nrepl.client
2-
(:require [clojure
3-
[edn :as edn]]
4-
[nrepl.core :as nrepl])
5-
(:import (java.io File)))
2+
(:require
3+
[clojure.edn :as edn]
4+
[clojure.string :as string]
5+
[nrepl.core :as nrepl])
6+
(:import
7+
(java.io File)))
68

79
(def ^:private nrepl-port
810
(when (.exists (File. ".nrepl-port"))
9-
(-> ".nrepl-port" slurp Integer/parseInt)))
11+
(-> ".nrepl-port" slurp string/split-lines first Integer/parseInt)))
1012

1113
(def ^:private transp (atom nil))
1214

0 commit comments

Comments
 (0)