On Jan 6, 10:06 pm, Allen Rohner <aroh...@gmail.com> wrote: > I had to revisit my test stubbing/expectation code after the recent > changes to test-is. The good news is, because of the excellent change > to make "is" a multi-method, the expectation code easily fits into > test-is. The following patch adds a new assertion for is, (is > (called?)) > > ;; creates a stub function, binds it to an existing var and asserts > ;; the stub fn was called the correct number of times. > > (is (called? [[user/foo :times 2 :returns 42] > [user/bar :times 1 :returns 3]] > (user/foo x y z) > (user/bar z))) > > Inside of the called? block, user/foo and user/bar are rebound to stub > functions, and then asserts that each function is called the proper > number of times. Currently, the only two options an expectation takes > are :times and :returns. I expect that more will be needed. > > http://groups.google.com/group/clojure/web/test_is_called.patch > > Allen
I noticed this hasn't been merged in. It's starting to cause some inconvenience to me because I have tests in my project that depend on the called? patch. If this still needs work before it's acceptable, let me know and I'll work on it. In the mean time, I'll create a fork on github that contains my patch. Allen --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---