-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix around macro to be called once per all children
- Loading branch information
1 parent
9c66a26
commit 2ec12f7
Showing
4 changed files
with
46 additions
and
9 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,22 @@ | ||
(ns context-tests.use-fixture | ||
(:require | ||
[lazytest.core :refer [around defdescribe expect it set-ns-context!]])) | ||
|
||
(def use-fixture-state (volatile! [])) | ||
|
||
(defn vconj! [volatile value] | ||
(vswap! volatile conj value)) | ||
|
||
(set-ns-context! | ||
[(around [f] | ||
(vconj! use-fixture-state :around-before) | ||
(f) | ||
(vconj! use-fixture-state :around-after))]) | ||
|
||
(defdescribe first-test | ||
(it "works normally" | ||
(expect (= 1 1)))) | ||
|
||
(defdescribe second-test | ||
(it "also works" | ||
(expect (= 1 1)))) |
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