From e288f64dbfc3ebf02e4748678009217290972bb8 Mon Sep 17 00:00:00 2001 From: Michael Jerger <michael.jerger@meissa-gmbh.de> Date: Thu, 20 Feb 2025 17:43:25 +0100 Subject: [PATCH] new way of including resources --- src/test/cljc/dda/c4k_forgejo/core_test.cljc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/test/cljc/dda/c4k_forgejo/core_test.cljc b/src/test/cljc/dda/c4k_forgejo/core_test.cljc index 936e6e0..70b469c 100644 --- a/src/test/cljc/dda/c4k_forgejo/core_test.cljc +++ b/src/test/cljc/dda/c4k_forgejo/core_test.cljc @@ -1,18 +1,15 @@ (ns dda.c4k-forgejo.core-test (:require - #?(:cljs [shadow.resource :as rc]) #?(:clj [clojure.test :refer [deftest is are testing run-tests]] :cljs [cljs.test :refer-macros [deftest is are testing run-tests]]) [clojure.spec.alpha :as s] [dda.c4k-common.yaml :as yaml] - [dda.c4k-forgejo.core :as cut])) + [dda.c4k-forgejo.core :as cut] + #?(:cljs [dda.c4k-common.macros :refer-macros [inline-resources]]))) #?(:cljs (defmethod yaml/load-resource :forgejo-test [resource-name] - (case resource-name - "forgejo-test/valid-auth.yaml" (rc/inline "forgejo-test/valid-auth.yaml") - "forgejo-test/valid-config.yaml" (rc/inline "forgejo-test/valid-config.yaml") - (throw (js/Error. "Undefined Resource!"))))) + (get (inline-resources "forgejo-test") resource-name))) (deftest validate-valid-resources (is (s/valid? cut/config? (yaml/load-as-edn "forgejo-test/valid-config.yaml")))