Hi! This is the first public release of my lib for mocking and stubbing in 
unit tests, I would greatly appreciate any feedback.

GitHub: https://github.com/metametadata/clj-fakes
Documentation: http://metametadata.github.io/clj-fakes/

*Features*
   
   - All test doubles are named "fakes" to simplify terminology
   - Fakes can be created for:
      - protocol and Java interface instances
      - functions
   - "Nice" and "strict" protocol fakes are supported
   - Monkey patching is supported to fake implicit dependencies
   - Self-testing: automatically checks for unused fakes
   - Test runner agnostic
   - Arrange-Act-Assert style testing

*Example of creating a mock object*

(defprotocol AnimalProtocol
  (speak [this name])); ...

(deftest example
  (f/with-fakes
    ; create fake instance of specified protocol
    (let [cow (f/reify-fake p/AnimalProtocol
                            ; ask framework to record method calls
                            (speak :recorded-fake))]
      ; call method on fake object
      (p/speak cow "Bob")

      ; assert that method was called with specified args
      (is (f/method-was-called p/speak cow ["Bob"])))))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to