File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 110110 (merge
111111 {'duct/env env/env
112112 'duct/include (make-include readers)
113- 'duct/resource resource}
113+ 'duct/resource resource
114+ 'duct/regex re-pattern}
114115 readers))
115116
116117(defn read-config
119120
120121 #duct/env
121122 : an environment variable, see [[duct.core.env/env]]
122-
123+
123124 #duct/include
124125 : substitute for a configuration on the classpath
125126
Original file line number Diff line number Diff line change 4848 {::a {:x 1 }} {::a (ig/refset ::b )} {::a (ig/refset ::b )}))
4949
5050(deftest test-read-config
51- (is (= (core/read-config (io/resource " duct/readers.edn" ) {'custom/bar (fn [x] {:x x})})
52- {:foo/a {:x " bar" }
53- :foo/b {:bar/a {:x 1 }, :bar/b (ig/ref :bar/a ) :bar/c {:baz/a {:x 1 }}}
54- :foo/c (core/resource " duct/config.edn" )
55- :foo/d (ig/ref :foo/a )
56- :foo/e (ig/refset :foo/b )})))
51+ (let [config (core/read-config (io/resource " duct/readers.edn" ) {'custom/bar (fn [x] {:x x})})]
52+ (is (= (dissoc config :foo/f )
53+ {:foo/a {:x " bar" }
54+ :foo/b {:bar/a {:x 1 }, :bar/b (ig/ref :bar/a ) :bar/c {:baz/a {:x 1 }}}
55+ :foo/c (core/resource " duct/config.edn" )
56+ :foo/d (ig/ref :foo/a )
57+ :foo/e (ig/refset :foo/b )}))
58+ (is (= (.pattern (:foo/f config))
59+ " baz" ))))
5760
5861(defmethod ig /init-key ::foo [_ {:keys [x]}]
5962 #(update % ::x (fnil conj []) x))
Original file line number Diff line number Diff line change 22 :foo/b #duct/include " duct/config.edn"
33 :foo/c #duct/resource " duct/config.edn"
44 :foo/d #ig/ref :foo/a
5- :foo/e #ig/refset :foo/b }
5+ :foo/e #ig/refset :foo/b
6+ :foo/f #duct/regex " baz" }
You can’t perform that action at this time.
0 commit comments