On 8/13/07, Shaker <
flyeminent@...> wrote:
>
> 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?
Yes, this is how Rails does it.
> 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?
My hunch is that you'll get the same behaviour with Test::Unit (try it).
You probably need to tell your spec that it must use more fixture
tables, to clean up before each example (it block).
Aslak
_______________________________________________
rspec-users mailing list
rspec-users@...
http://rubyforge.org/mailman/listinfo/rspec-users