Fixtures is too broad of a concept to be dismissed entirely. When Rails introduced it (not to say it got invented at that stage), fixtures were YAML files containing properties for AR models. *that* in particular can, in general, be done more effectively with factory-like classes, since it helps with the problem of your test suite being tied to the sanity of the fixtures themselves. i.e.: you'll need to maintain your fixtures as well as the test suite.
However, say you're writing a class that processes HTML. It's pretty likely you're better off having a bunch of fixture HTML files, one for each case it could possibly face, rather than writing a builder of sorts, since it could get pretty complex and end up defeating the purpose of using factories altogether. This isn't an excellent example, but the point is: there's a threshold. On Thu, Jan 20, 2011 at 4:33 PM, Joshua Partogi <[email protected]> wrote: > Hi all, > > Can anyone explain what are the cases when to use fixtures/factory > girl over mock framework? Or can we use mock framework without the > need to use fixtures/factory girl these days? > > Thanks heaps for sharing. > > Kind regards, > Joshua. > > -- > http://twitter.com/jpartogi > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rails-oceania?hl=en. > > -- http://awesomebydesign.com -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
