You're viewing version 1.2.0 of use-fixtures. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

use-fixtures

clojure.test

Wrap test runs in a fixture function to perform setup and
teardown. Using a fixture-type of :each wraps every test
individually, while:once wraps the whole run in a single function.

1 Example top

  • (use-fixtures :once
        (fn [your-tests]
            (spin-db)
            (your-tests)
            (kill-db)))
    
    (deftest tests-you-want-wrapped)
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/test.clj:641 top

(defmulti use-fixtures
  "Wrap test runs in a fixture function to perform setup and
  teardown. Using a fixture-type of :each wraps every test
  individually, while:once wraps the whole run in a single function."
  {:added "1.1"}
  (fn [fixture-type & args] fixture-type))
Vars in clojure.test/use-fixtures: defmulti fn
Used in 0 other vars

Comments top

No comments for use-fixtures. Log in to add a comment.