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' assertions in my with-test for one specific function. If you do anything outside an assertion you get an error saying you were outside an assertion. Small point, and as you say easily worked around, but it would seem to me to be within the spirit of the with-test idea i.e. making the test code closely tied to the function, if you could do a function specific fixture?? On May 6, 2:34 pm, Sean Devlin <[email protected]> wrote: > Can you just use a local let in the specific test? > > On May 6, 6:41 am, Quzanti <[email protected]> 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 doing it once > > around all the tests in that namespace > > > What happens if you want to do some setup just for one particular test > > that you want to use a with-test structure for? Can you put non- > > assertion lines outside the scope of the function being tested, but > > within the scope of with-test > > > I though of going an (is (= nil (mysetup-stuff))) but that is quite a > > hack > > > I know also that I may be being obsessive as normally all tests on a > > namespace will get run together so :once will do the job, but I have > > this hitch to put setup code that only applies to testing that > > function within the with-test for that fn. > > > Thanks/ > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to [email protected] > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group > > athttp://groups.google.com/group/clojure?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
