Unit tests with specs
In this example the result of a call to
register-account-holder is checked to see if it is valid against the
::account-holder specification. This simplifies the code needed in unit test assertions, as Clojure spec is doing the work.
(deftest register-account-holder-test (testing "Basic registration - happy path" (is (= (set (keys (SUT/register-account-holder customer-mock))) (set (keys account-holder)))) (is (spec/valid? :practicalli.bank-account-spec/account-holder (SUT/register-account-holder customer-mock) ) ) ))