Named Test Fixtures
In one of my projects, I have tons of units and functional tests. To speed things up, I set my configuration like this: In my tests, instead of accessing @bob, I now have to do: Works, but isn’t this very verbose ? So, I created myself a little helper:: All great and dandy. I wanted to share with the community, so I started digging into fixtures.rb to implement it. Much to my surprise, this already exists:
So, I guess I’m going to send a documentation patch instead of code !
UPDATE 1* (Oct 18, 2005): Well, would you look at that, this is all documented in the Class: Fixtures (See the last paragraph under Using Fixtures)
UPDATE 2 (Oct 25, 2005): Rails 0.14.1 is pre-configured like that. In fact, Mike Clark wrote Faster Testing with Rails 1.0 to explain the new behavior.
Leave a Reply