An Overview of the API
Atticus is a test helper library.
atticus.factory
by
unknown author
Detailed API documentation
Factory methods to generate defrecord instances for use in testing. Inspired by
notahat's machinist gem.
You can refer to (lexically) previous fields when defining the factory.
(defrecords make-rec my.ns.SomeRecord
:n 1 :o (inc (:n %)))
(make-rec)
=> {:n 1 :o 2}
Overriding a single value will cause it to be picked up in computed expressions
(make-rec :n 2)
=> {:n 2 :o 3}
Computed fields can also be set explicitly.
(make-user :o 1)
=> {:n 1 :o 1}
Public variables and functions:
clj-fields defrecords set-fields
atticus.mock
by
unknown author
Detailed API documentation
Simple Mocking in Clojure. Allows you to implement the mock function as a
lambda.
(deftest with-1-test
(expects
[(f [arg] (is (= arg 1) "Check argument") arg)]
(is (= 1 (f 1)) "Call mocked function")))
(deftest with-1-once-test
(expects
[(f [arg] (once (inc arg)))]
(is (= 1 (f 1)) "Call mocked function")))
(deftest with-1-times-test
(expects
[(f [arg] (times 2 arg))]
(is (= 1 (f 1)) "Call mocked function")
(is (= 1 (f 1)) "Call mocked function")))
Public variables and functions:
add-expectation add-mock construct-bindings construct-mock expects once times
atticus.stub
by
unknown author
Detailed API documentation
Stub objects for testing.
Public variables and functions:
eval-constant stub
atticus.utils
by
unknown author
Detailed API documentation
Public variables and functions:
tmpfile with-temporary-file