Skip to content

Commit

Permalink
test: Fix tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Oct 12, 2024
1 parent bb16717 commit 80dd7bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions example-plugin/plugin.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:name "elin core example plugin"
:handlers [elin-example.core/hello]
:interceptors [elin-example.core/interceptor]}
:export {:handler {:includes [elin-example.core/hello]}
:interceptor {:includes [elin-example.core/interceptor]}}}
8 changes: 4 additions & 4 deletions test/elin/component/interceptor_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
sut/wrap-interceptor-for-logging identity]
(t/testing "only includes"
(t/is (= {::test [test-interceptor]}
(-> {:includes [(symbol #'test-interceptor)]}
(-> {:base-config {:includes [(symbol #'test-interceptor)]}}
(sut/map->Interceptor)
(component/start)
(:interceptor-map)))))
Expand All @@ -96,8 +96,8 @@

(t/testing "includes and excludes"
(t/is (= {::test [test-interceptor]}
(-> {:includes [(symbol #'test-interceptor)]
:excludes [(symbol #'test-interceptor)]}
(-> {:base-config {:includes [(symbol #'test-interceptor)]
:excludes [(symbol #'test-interceptor)]}}
(sut/map->Interceptor)
(component/start)
(:interceptor-map)))
Expand All @@ -106,7 +106,7 @@
(t/deftest new-interceptor-configure-includes-excludes-test
(with-redefs [m/validate (constantly true)
sut/wrap-interceptor-for-logging identity]
(let [interceptor (-> {:includes [(symbol #'test-interceptor)]}
(let [interceptor (-> {:base-config {:includes [(symbol #'test-interceptor)]}}
(sut/map->Interceptor)
(component/start))]
(t/testing "only includes"
Expand Down
8 changes: 3 additions & 5 deletions test/elin/component/plugin_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
(component/start-system))]
(try
(t/is (= {:name (str ::sut/plugin)
:handlers '[elin-example.core/hello]
:interceptors '[elin-example.core/interceptor]}
:export {:handler {:includes '[elin-example.core/hello]}
:interceptor {:includes '[elin-example.core/interceptor]}}}
(:loaded-plugin plugin)))
(finally
(component/stop-system sys)))))
Expand All @@ -28,9 +28,7 @@
(select-keys [:lazy-host :plugin])
(component/start-system))]
(try
(t/is (= {:name (str ::sut/plugin)
:handlers []
:interceptors []}
(t/is (= {:name (str ::sut/plugin)}
(:loaded-plugin plugin)))
(finally
(component/stop-system sys)))))

0 comments on commit 80dd7bd

Please sign in to comment.