-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw exception on non-existent key for update-key (#23)
* Add `update-key-test` Co-authored-by: Mikhail Kuzmin <[email protected]> Co-authored-by: Nikita Domnitskii <[email protected]> * Fix `update-key` Co-authored-by: Mikhail Kuzmin <[email protected]> Co-authored-by: Nikita Domnitskii <[email protected]> * Refactor `update-key` Co-authored-by: Nikita Domnitskii <[email protected]> Co-authored-by: Gleb Eliseev <[email protected]> * use ex-info * mark the test as a bug test * fix style * use thrown-with-msg? --------- Co-authored-by: Gleb Eeliseev <[email protected]> Co-authored-by: Nikita Domnitskii <[email protected]>
- Loading branch information
1 parent
25d0658
commit 21d978e
Showing
2 changed files
with
37 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns darkleaf.di.update-key-test | ||
(:require | ||
[clojure.test :as t] | ||
[darkleaf.di.core :as di]) | ||
(:import | ||
(clojure.lang ExceptionInfo))) | ||
|
||
(t/deftest bug--update-non-existent-key-test | ||
(t/is (thrown-with-msg? | ||
ExceptionInfo | ||
#"\ACan't update non-existent key :darkleaf.di.update-key-test/component-with-typo\z" | ||
(di/start ::component | ||
{::component 1} | ||
(di/update-key ::component-with-typo inc))))) |