fix test resource

This commit is contained in:
jem 2021-07-09 17:17:14 +02:00
parent 930e520c42
commit 00651fa386
2 changed files with 6 additions and 6 deletions

View file

@ -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!"))))

View file

@ -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"))))