From e2fba5d996115bd77c58a90fb3545287174c2cdd Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 9 Mar 2024 15:36:44 +0000 Subject: [PATCH] fix reload-all and test --- CHANGELOG.md | 4 ++++ project.clj | 2 +- src/cider/nrepl/middleware/reload.clj | 2 +- test/clj/cider/nrepl/middleware/reload_test.clj | 7 +++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 311ecf58..586b0fdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master (unreleased) +## Bugs fixed + +* [#854](https://github.com/clojure-emacs/cider-nrepl/pull/854): fix cider.clj-reload/reload-all and improve its test + ## 0.46.0 (2024-0305) ### New features diff --git a/project.clj b/project.clj index 1c4ba73c..2bff4216 100644 --- a/project.clj +++ b/project.clj @@ -19,7 +19,7 @@ ~(with-meta '[org.clojure/tools.namespace "1.3.0"] ;; :cognitest uses tools.namespace, so we cannot inline it while running tests. {:inline-dep (not= "true" (System/getenv "SKIP_INLINING_TEST_DEPS"))}) - ^:inline-dep [io.github.tonsky/clj-reload "0.4.0"] + ^:inline-dep [io.github.tonsky/clj-reload "0.4.1"] ^:inline-dep [org.clojure/tools.trace "0.7.11"] ^:inline-dep [org.clojure/tools.reader "1.3.6"] [mx.cider/logjam "0.3.0"]] diff --git a/src/cider/nrepl/middleware/reload.clj b/src/cider/nrepl/middleware/reload.clj index 32ea6c30..244f0b4d 100644 --- a/src/cider/nrepl/middleware/reload.clj +++ b/src/cider/nrepl/middleware/reload.clj @@ -37,7 +37,7 @@ reload (user-reload 'reload reload/reload) unload (user-reload 'unload reload/unload)] (cond - (:all msg) (reload (assoc opts :all true)) + (:all msg) (reload (assoc opts :only :all)) (:clear msg) (unload opts) :else (reload opts)))) diff --git a/test/clj/cider/nrepl/middleware/reload_test.clj b/test/clj/cider/nrepl/middleware/reload_test.clj index 2fd81144..d9a292c4 100644 --- a/test/clj/cider/nrepl/middleware/reload_test.clj +++ b/test/clj/cider/nrepl/middleware/reload_test.clj @@ -2,6 +2,7 @@ (:require [cider.nrepl.middleware.reload :as rl] [cider.nrepl.test-session :as session] + [clojure.string :as str] [clojure.test :refer :all])) (use-fixtures :each session/session-fixture) @@ -33,8 +34,10 @@ (deftest reload-all-op-test (testing "reload-all op works" - (let [response (session/message {:op "cider.clj-reload/reload-all"})] - (is (seq (:progress response))) + (let [response (session/message {:op "cider.clj-reload/reload-all"}) + progress-str (:progress response)] + (is (str/includes? progress-str "Unloading cider.nrepl.middleware.util.meta-test")) + (is (str/includes? progress-str "Loading cider.nrepl.middleware.util.meta-test")) (is (= #{"done" "ok"} (:status response)))))) (deftest reload-clear-op-test