fix test resource

merge-requests/1/merge
jem 3 years ago
parent 930e520c42
commit 00651fa386

@ -1,7 +1,6 @@
(ns dda.c4k-common.yaml
(:require
["js-yaml" :as yaml]
[shadow.resource :as rc]
[clojure.string :as st]))
(defn from-string [input]
@ -16,8 +15,3 @@
(keyword (first (st/split resource #"/"))))
(defmulti load-resource dispatch-by-resource-name)
(defmethod load-resource :test [resource-name]
(case resource-name
"test/ingress_test.yaml" (rc/inline "test/ingress_test.yaml")
(throw (js/Error. "Undefined Resource!"))))

@ -1,8 +1,14 @@
(ns dda.c4k-common.yaml-test
(:require
[cljs.test :refer-macros [deftest is are testing run-tests]]
[shadow.resource :as rc]
[dda.c4k-common.yaml :as cut]))
(defmethod cut/load-resource :test [resource-name]
(case resource-name
"test/ingress_test.yaml" (rc/inline "test/ingress_test.yaml")
(throw (js/Error. "Undefined Resource!"))))
(deftest should-dispatch-by-resource-name
(is (= :postgres
(cut/dispatch-by-resource-name "postgres/etc"))))

Loading…
Cancel
Save