[rspec-users] Problem of using fixture in Rspec

Shaker flyeminent at hotmail.com
Sun Aug 12 20:43:03 EDT 2007

Dear Fellows:
    I was using fixtures in the model tests using Rspec. I found that the
test data specified in the fixtures was stored in the test database once I
ran the spec and won't be removed anyway. Is my observation correct?
    There might be another problem regarding the fixtures. When I ran the
specs one by one, it was working. However, it failed when I tried to run all
the specs in one command. It seemed that the test data which was modified by
one spec caused the other spec which accessed that particular data to fail.
In other words, the data is actually kind of public to all specs, so the
specs shares one copy of test data. 
    If my observation is correct, are there any ways to overcome these
problems? Is it possible that each single spec owns its test data so that
the modifications on the data will not affect other specs?
View this message in context: http://www.nabble.com/Problem-of-using-fixture-in-Rspec-tf4258669.html#a12119520
Sent from the rspec-users mailing list archive at Nabble.com.

More information about the rspec-users mailing list