Re: Dumbest test Q you ever heard

2010-05-13 Thread Quzanti
I have written something to convince myself that things behave as I expected e.g. each runs only once per test, not once per assertion http://gist.github.com/399638 It handles the fact that tests can be run in any order by using a Set which gets added to when any function is run (so if the

Re: Dumbest test Q you ever heard

2010-05-12 Thread Quzanti
Hi Now I am a bit baffled as how to store a fixture (eg a parsed xml zipper) As a fixture is a function you can't do a def within it? Instead of me carrying on asking dumb questions I would be really grateful if someone could point me to some source code or examples where the test framework is

Re: Dumbest test Q you ever heard

2010-05-12 Thread Quzanti
Found an :each example using binding - is that the suggested option? Would still be really grateful for a link to the best examples of using the test framework out there. Thanks. On May 12, 7:10 pm, Quzanti quza...@googlemail.com wrote: Hi Now I am a bit baffled as how to store a fixture (eg

Re: Dumbest test Q you ever heard

2010-05-07 Thread Stuart Sierra
On May 6, 12:40 pm, Quzanti quza...@googlemail.com wrote: If you do anything outside an assertion you get an error saying you were outside an assertion. No, clojure.test permits any arbitrary code inside deftest. If you get an error saying Uncaught exception, not in assertion it means that

Re: Dumbest test Q you ever heard

2010-05-06 Thread Sean Devlin
Can you just use a local let in the specific test? On May 6, 6:41 am, Quzanti quza...@googlemail.com wrote: Sorry about this, but after an hour's googling I have drawn a blank. For clojure.test fixtures I understand you use :each for doing something around each and every test, and :once for

Re: Dumbest test Q you ever heard

2010-05-06 Thread Quzanti
I probably could, although again it would be a bit of a hack, as I want to 'do' some preparation rather than assign anything (specifically I need to 'touch' some files before testing a function which is modification time sensitive) So I want something that happens before all several 'is'